This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I have a problem writing a Spring-Unit-Test extending AbstractDependencyInjectionSpringContextTests. The TestClass (Bean) includes a property of a bean that I want to test. Injection of that bean happens well. The bean to test extends "SimpleJdbcDaoSupport". Every configuration (jdbcTemplate/datasource) is done well (in my opinion).
I want to test a database operation and the method invokation happens well. But than the following error occures:
This happens normally, when the jar with the db drivers are not in the classpath. But they are.
So, does anybody knows about a reason for this problem. Maybe using a Test Class which extends AbstractDependencyInjectionSpringContextTests does not inject all propertys needed in reference bean which I want to test (especially the jdbcTemplate property).
Every configuration (jdbcTemplate/datasource) is done well (in my opinion).
Should we guess your configuration or are you are going to post it?
Franz van Betteraey
Joined: Jun 20, 2007
I will post it :-)
After some more debugging (and logging) I am very sure, that all injection is done correctly and also the class to test (de.mycompany.myproject.dao.myDaoImpl) has a correct refence to the DataSource. So it must be some kind of classpath problem I cant figure out. The necessary DB2 Jar's are in the classpath, but apperently can not be found while establishing the connection.
I assume that ist is hard to comprehend the problem but any hint what to check is still welcome.