| 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
|
 |
 |
|
|
subject: BeanCreationException: while using Autowiring fro DAO controller
|
|
|