File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes BeanCreationException:  while using Autowiring  fro DAO controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "BeanCreationException:  while using Autowiring  fro DAO controller" Watch "BeanCreationException:  while using Autowiring  fro DAO controller" New topic
Author

BeanCreationException: while using Autowiring fro DAO controller

Dushyant Chhetri
Ranch Hand

Joined: Oct 28, 2009
Posts: 75
Hi All,

I am learning spring and am trying to create a simple login example where the authentication is done by comparing the username and password from a database.

I have autowired in the controller as follows:



My dao class is as follows:



The application context xml is as follows:



I have also kept

in the spring-servlet.xml file.

Despite all these I am getting
Exception Error creating bean with name 'loginController'


org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.dao.LoginDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}


Please suggest where I am going wrong.
Dushyant Chhetri
Ranch Hand

Joined: Oct 28, 2009
Posts: 75
Found it ,

had'nt put in the listener for contextloader in my web.xml file



http://www.coderanch.com/t/586046/Spring/NoSuchBeanDefinitionException-spring-mybatis#2667497


Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: BeanCreationException: while using Autowiring fro DAO controller
 
Similar Threads
Not able to Validate form using JSR-303 validation implementation in Spring MVC
DI is not working in my example.
Error with Transaction Interceptor
Help with this code!
Neither BindingResult nor plain target object for bean name 'loginForm