I had a look at the source code around this issue. Here is a summary:
 
The 'Cannot load JDBC driver class 'null'' message is coming from the
createDataSource method in DBCP. The method throws an exception for
driverClass = Class.forName(driverClassName). So, from this I think I
can assume the problem is that the driverClassName is not being set.
 
In the struts code, the setting of the driver class name is contained
within the GenericDataSource object with the call
bds.setDriverClassName(getDriverClass()). Bds is a BasicDataSource that
is instantiated within the GenericDataSource context.
 
GenericDataSource has been deprecated, so now the question becomes how
to set the driver class name for a basic data source using the
struts-config.xml file.
 
Looking at DataSourceConfig.java, there is a big warning at the top of
the file stating that "The properties of this configuration bean are
recognized by the default data source implementation, but some or all of
them may be ignored by custom data source implementations." The default
source implementation is GenericDataSource, not BasicDataSource.
 
So, I think this is the issue. GenericDataSources are deprecated in
favour of BasicDataSources, but BasicDataSources are not supported in
the struts-config.xml. 
 
So, I removed the type= from the data-source and this error message goes
away!
 
The moral: Just because something is deprecated doesn't mean it has a
working replacement. ;-)
 
-david-

Reply via email to