This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Spring and the fly likes IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "IllegalArgumentException: Watch "IllegalArgumentException: New topic

IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required

Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
I believe I've properly configured my data source, however, I continually get the following error:
Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required

Below is my bean declaration and class, anyone see what is/could be wrong?

Note: JdbcDaoImpl has it's own dataSource and jdbcTemplate properties and getters/setters
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

So it seems to need a JDBCTemplate passed in to it, just like you did with the dataSource. Just create a bean with JDBCTemplate passing dataSource in to a contructor-arg. Then inject the jdbcTemplate into the UserDetailsService bean there.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: IllegalArgumentException: 'dataSource' or 'jdbcTemplate' is required
It's not a secret anymore!