This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Spring and the fly likes Autowiring of data source not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Autowiring of data source not working" Watch "Autowiring of data source not working" New topic

Autowiring of data source not working

Jehan Jaleel
Ranch Hand

Joined: Apr 30, 2002
Posts: 196

I have a simple example where I have a Spring service bean that I want to use to query the DB (I know I should probably use a DAO but this is just an example), I have the following code...

Interface file...

Implementation file..

And in my Spring config file I have...

Right now this is giving exception...

Any suggestions?

H Paul
Ranch Hand

Joined: Jul 26, 2011
Posts: 471
First, have a check the location of the @Service annotation.
Should it be on interface or implementation?
I agree. Here's the link:
subject: Autowiring of data source not working
It's not a secret anymore!