File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

BeanCreationException: while using Autowiring fro DAO controller

 
Dushyant Chhetri
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic