In my project, i use basically microservice architecture, spring boot, spring cloud and gradle etc.
When i tried to Gradle build, it takes error but when i tried to running to the my application, it runs properly.
I searched too many resource but i didn't find any solution. No solution suggestions worked for me and error explanation is not specific which it is too general
CodePudding user response:
This is a common error complaining that what ever you marked with @Autowire, cannot point to an implementation. So mainly could be for 2 reasons.
- You have an interface, but you have not implement it via a class
- You have implemented one with a class but it's not in the spring dependency injectable context, in this case mark it as @Component with the relevant interface implementation.
CodePudding user response:
I found to error's resource and error's solution. Error's resource some class contains @autowired annotation in test package so for this situation, I must use SpringBootTest and RunWith(springrunner.class). If I dont use, i take error. For me i used these annotations but SpringBootTest i use wrong location @SpringBootTest(classes = {ABC.class}) I changed to correct location and it works :).
