-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pollController' #2
Comments
Hi, Since your package names are different, you will need to change the fully qualified class name of the @Query("SELECT NEW com.example.polls.model.ChoiceVoteCount(v.choice.id, count(v.id)) FROM Vote v WHERE v.poll.id in :pollIds GROUP BY v.choice.id")
List<ChoiceVoteCount> countByPollIdInGroupByChoiceId(@Param("pollIds") List<Long> pollIds);
@Query("SELECT NEW com.example.polls.model.ChoiceVoteCount(v.choice.id, count(v.id)) FROM Vote v WHERE v.poll.id = :pollId GROUP BY v.choice.id")
List<ChoiceVoteCount> countByPollIdGroupByChoiceId(@Param("pollId") Long pollId); Change the |
Hi at first thank you for this good tutorial! I did all steps from your tutorial with th same package name com.example.polls.model and i have this error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pollController': Unsatisfied dependency expressed through field 'pollService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pollService': Unsatisfied dependency expressed through field 'voteRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voteRepository': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/hql/internal/ast/tree/FromElement [WARNING] |
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'pollController': Unsatisfied dependency expressed through field 'voteRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'voteRepository': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.example.final2.repository.VoteRepository.countByPollIdInGroupByChoiceId(java.util.List)!
Hello, I did all steps from your tutorial, there is one error. Thank you!
The text was updated successfully, but these errors were encountered: