What class loader is loading your application class?

Attila




                                                                           
             "Balazs Vojtek"                                               
             <balazs.vojtek@ge                                             
             nerali.sk>                                                 To 
             Sent by:                  java400-l@xxxxxxxxxxxx              
             java400-l-bounces                                          cc 
             @midrange.com                                                 
                                                                   Subject 
                                       ClassCastException on Tomcat JNDI   
             12/01/2003 07:58          lookup                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             Java Programming                                              
             on and around the                                             
              iSeries / AS400                                              
             <java400-l@midran                                             
                  ge.com>                                                  
                                                                           
                                                                           




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
_______________________________________________
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.