|
Hello, I'm trying to set up an AS400JDBCConnectionPoolData Source on Tomcat, but it returns me this bloody ClassCastException. The code I'm using to wake up the data source is the following: Context envCtx = (Context) new InitialContext().lookup("java:comp/env"); AS400JDBCConnectionPoolDataSource ds = (AS400JDBCConnectionPoolDataSource)envCtx.lookup("jdbc/genbra"); Connection conn = ds.getConnection(); The context has the following settings: <Context className="org.apache.catalina.core.StandardContext" cachingAllowed="true" charsetMapperClass="org.apache.catalina.util.CharsetMapper" cookies="true" crossContext="true" debug="1" docBase="C:\ProgramFiles\Apache Group\Tomcat 4.1\webapps\JNDItest" mapperClass="org.apache.catalina.core.StandardContextMapper" path="/jndi" privileged="false" reloadable="true" swallowOutput="false" useNaming="true" wrapperClass="org.apache.catalina.core.StandardWrapper"> <Resource name="jdbc/genbra" scope="Shareable" type="javax.sql.DataSource"/> <ResourceParams name="jdbc/genbra"> <parameter> <name>maxWait</name> <value>5000</value> </parameter> <parameter> <name>maxActive</name> <value>4</value> </parameter> <parameter> <name>password</name> <value>password</value> </parameter> <parameter> <name>url</name> <value>genbra</value> </parameter> <parameter> <name>driverClassName</name> <value>com.ibm.as400.access.AS400JDBCConnectionPoolDataSource</value> </parameter> <parameter> <name>maxIdle</name> <value>2</value> </parameter> <parameter> <name>username</name> <value>username</value> </parameter> </ResourceParams> </Context> I've read in the IBM program development FAQ that this error is because the requred jt400.jar is not on the client application classpath. But I have the jt400.jar file deployed in the Tomcat\common\lib library. I've tried several things 1 - To remove the jt400.jar file from classpath, then I received a ClassNotFoundException 2 - If I specified a non-existing name in the context lookup, it returned a NamingException that the name is not bound to the context. So it seems that the context is constructed well, but there is an error by generating the AS400JDBCConnectionPoolDataSource What else can be wrong here? Thank you for your answer Balazs
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.