You need to specify the location of the external jar file as part of the java command. It would be something like this. If you add any files,it will delete all existing files related to this question- questions only answer remains unchanged. Your request will be Queued. We will review the question and remove. It may take some days. If you add any files,it will delete all existing files related to this answer- only this answer.
Tunaki k 42 42 gold badges silver badges bronze badges. Benjamin Boutier Benjamin Boutier 7 7 silver badges 6 6 bronze badges. This was actually my problem. Thanks for the answer Accepting this as the answer. In my application that is pulling in the library, I had to make sure to include the package of the lib in the ComponentScan. I didn't quite have it right, and after double checking, I made it right. Thanks again! Maybe the problem come from the external library itself that should annotate the interface as well?
This answer still helped me in my Spring 5 project. Thx for the sollution. May I ask, I have class Config. Do you know why it does not work? Add a comment. Maleck13 Maleck13 1, 14 14 silver badges 17 17 bronze badges. Yes, after I figured out what was going on and playing around with it a little more, I noticed I could create the bean like that.
This won't work if you're trying to autowire an interface. TuGordoBello 3, 7 7 gold badges 40 40 silver badges 69 69 bronze badges. Holgi P Holgi P 1 1 silver badge 2 2 bronze badges. Thank you! Solved my problem for feign clients too. Excellent answer. I have included this jar file inside my spring boot application and trying to autowire the interface like this from a controller:. The repository is not getting autowired. When I am firing up the Spring boor application I am getting the following error:.
If your JPA repositories are in a different package than your Spring Boot application class, you have to specify that package on the EnableJpaRepositories annotation, not Component :. Logger; import org. LoggerFactory; import org. SpringApplication; import org.
0コメント