This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autowiring problem in controller

 
rachit mehra
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am tiring to build a small application in spring 3.2.2.RELEASE but when i am tiring to inject the service layer object into controller class by @Autowired it create a some problem, here is the code

controller class BooksEntryController .java


service interface


service implementation class


logs of the error


can any one suggest me how to resolve this injection problem?
 
Ameet Sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might help...
have you added @Repository("bookFormDao") in your BookFormDao class???
 
Himanshu bisht bebo
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try to put a defalult constructor in your @service class , It may solve your problem
 
Ameet Sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might help...
have you added @Repository("bookFormDao") in your BookFormDao implementation class(assuming that BookFormDao is your interface)???
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have component scan properly scanning the correct packages? It seems that bean is not being found and created.
 
rachit mehra
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I am using the hibernate 4.

Now the problem has resolved

I have changed "hibernate3.annotation.AnnotationSessionFactoryBean" to "hibernate4.LocalSessionFactoryBean "

From:




To:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic