aspose file tools*
The moose likes Spring and the fly likes Autowiring  problem in controller Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Autowiring  problem in controller" Watch "Autowiring  problem in controller" New topic
Author

Autowiring problem in controller

rachit mehra
Greenhorn

Joined: Jul 06, 2011
Posts: 13
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

Joined: Aug 17, 2012
Posts: 7
This might help...
have you added @Repository("bookFormDao") in your BookFormDao class???
Himanshu bisht bebo
Greenhorn

Joined: Jun 12, 2012
Posts: 16
Please try to put a defalult constructor in your @service class , It may solve your problem
Ameet Sagar
Greenhorn

Joined: Aug 17, 2012
Posts: 7
This might help...
have you added @Repository("bookFormDao") in your BookFormDao implementation class(assuming that BookFormDao is your interface)???
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1648
    
    7

Do you have component scan properly scanning the correct packages? It seems that bean is not being found and created.


[How To Ask Questions][Read before you PM me]
rachit mehra
Greenhorn

Joined: Jul 06, 2011
Posts: 13
Actually I am using the hibernate 4.

Now the problem has resolved

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

From:




To:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Autowiring problem in controller