Answer the question
In order to leave comments, you need to log in
How to force Spring to inline interfaces?
Good day.
I was programming somehow, and I ran into a rather strange situation.
Beans do not want either to be initialized or embedded in other components, and it is not clear why, what and how.
Github of the project (and immediately to the desired branch
When trying to deploy, the following error (cuttings) is issued: "... Error creating bean with name 'answerRepository' ... method setDao(AnswerDao) ... No qualifying bean of type [AnswerDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}".
Although idea sees everything perfectly what should work and how.
In this project, everything works fine (meaning the injection of dao interfaces into controllers ).
I also tried to get the same beans, or their real types (no longer interfaces) with src/Test/main(...) both by name and by alias, and by type - no success. And all other beans (not dao) are normally embedded.
On the branch of the git, to which I threw off the address, the current snapshot of my directory with the project was taken.
I have been fighting with the error itself for the 2nd day, and so far it is winning.
Thank you for your attention,
I hope for your help ;-) Best
regards,
Andrey.
Answer the question
In order to leave comments, you need to log in
So, the problem is solved. Not standard, but it was solved:
the problem was that my dao implementations did not inherit the dao interfaces corresponding to them, and spring could not inject the dependency.
This old commit (which was made by my classmate whom I "teach"), and he suddenly disobeyed something, and implemented the wrong interfaces in all dao implementations, there was:
public class QuestionTagOracleDaoImplement
extends AbstractOracleDaoImplement<QuestionTagsEntity, Integer>
implements QuestionTagOperations, DefaultDao<QuestionTagsEntity, Integer>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question