What is the difference between declaring @Autowired and declaring bean in the application context

I build the spring project1 of module1 as a jar file, then added this jar file dependency in another module2 of project2, then the module2 is added in the project3. Now, while starting the tomcat service getting the error as NoSuchBeanDefinitionException for Module1 class object.

While checking with module2 code found injected module1 class object using @Autowired annotation, By including the bean declaration in xml (<bean id="object" class="claspackage"/>. Issue has been fixed. but I am unable to find the root cause for this, how the bean functionality got differs?


Source: java

Leave a Reply