Hi all,
I'm getting a the following ClassCastException running Tomcat 5.5.9 with
MySQL
java.lang.ClassCastException: org.apache.tomcat.dbcp.dbcp.BasicDataSource
Here's the relevant code:
*Java code:*
org.apache.commons.dbcp.BasicDataSource datasource;
datasource = (BasicDataSource)ctx.lookup("java:comp/env/jdbc/myserver");
*web.xml*
<resource-ref>
<description>DB Connection</description>
<res-ref-name>jdbc/myserver</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
*server.xml*
*....*
<ResourceParams name="jdbc/myserver">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
*...*
This same code works in Tomcat 5.0.30.
Has anything changed? Am I missing something?
Thanks.