Hi, My Error ->> Cannot Load JDBC class 'null' .

Any suggestions would be great !

1. I downloaded Tomcat 5.0.12,
2. Read 2 articles about this problem
         ( King Daniel & Alessandra Nanni )

3.  JARS ( classes12 & commons-*, in common/lib
         
4. In server.xml put lines

<!-- Global JNDI resources -->
  �<GlobalNamingResources>

    �<!-- Test entry for demonstration purposes -->

    �<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
        �<!-- Editable user database that can also be used by
� � � �     UserDatabaseRealm to authenticate users -->


        �<Resource auth="Container" 
                   description="Oracle 9i database" 
                   name="myDataSource" 
                   scope="Shareable"
                   type="javax.sql.DataSource" />

        �<ResourceParams name="myDataSource">
        � <parameter>
          � �<name>factory</name>
            �<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
        � </parameter>
        � <parameter>
          � �<name>driverClassName</name>
            �<value>oracle.jdbc.driver.OracleDriver</value>
        � </parameter>
        � <parameter>
          � �<name>url</name>
          � �<value>jdbc:oracle:thin:@localhost:1521:mydb</value>
          </parameter>
          E.t.c.

� </ResourceParams>

</GlobalNamingResources>


And   Context lines

<Context className="org.apache.catalina.core.StandardContext"
                 cachingAllowed="true"
                 charsetMapperClass="org.apache.catalina.util.CharsetMapper"
                 cookies="true" 
                 crossContext="false" 
                 debug="0" 
                 displayName="Apache-Axis"
                 docBase="\Mywebapp"
                 mapperClass="org.apache.catalina.core.StandardContextMapper"
                 path="$CATALINA_HOME/webapps/Mywebapp"
                 privileged="false"
                 reloadable="false" 
                 swallowOutput="false" 
                 useNaming="true"
                 wrapperClass="org.apache.catalina.core.StandardWrapper">

� � � � <Logger className="org.apache.catalina.logger.FileLogger"
                prefix="localhost_our_application_log." 
                suffix=".txt"
                timestamp="true"/>

        <ResourceLink global="myDataSource" name="jdbc/myoracle"/>

        </Context>

And it does not WORKS . :(


Thank you very very much!!!

 Andrey !



ANei> The servlet.jar and classes12.jar should be under $CATALINA_HOME/common/lib
ANei> I configured my server.xml to Oracle 9 using the jndi through the
ANei> GlobalNamingResources and it works

ANei> �<GlobalNamingResources>
ANei> �<!-- Test entry for demonstration purposes -->
ANei> �<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
ANei> �<!-- Editable user database that can also be used by
ANei> � � � � UserDatabaseRealm to authenticate users -->
ANei> �<Resource auth="Container" description="Oracle 9i database"
ANei> name="jdbc/myoracle" type="javax.sql.DataSource"/>
ANei> �<ResourceParams name="jdbc/myoracle">
ANei> � <parameter>
ANei> � �<name>factory</name>
ANei> � �<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
ANei> � </parameter>
ANei> � <parameter>
ANei> � �<name>driverClassName</name>
ANei> � �<value>oracle.jdbc.driver.OracleDriver</value>
ANei> � </parameter>
ANei> � <parameter>
ANei> � �<name>url</name>
ANei> � �<value>jdbc:oracle:thin:@ourserver:1521:ourdatabase</value>
ANei> � </parameter>
ANei> � <parameter>
ANei> � �<name>username</name>
ANei> � �<value>xyz</value>
ANei> � </parameter>
ANei> � <parameter>
ANei> � �<name>password</name>
ANei> � �<value>xyz</value>
ANei> � </parameter>
ANei> � � � � � � � � � � � �<parameter>
ANei> � � � � � � � � � � � � � � � �<name>maxActive</name>
ANei> � � � � � � � � � � � � � � � �<value>80</value>
ANei> � � � � � � � � � � � �</parameter>
ANei> � � � � � � � � � � � �<parameter>
ANei> � � � � � � � � � � � � � � � �<name>maxIdle</name>
ANei> � � � � � � � � � � � � � � � �<value>40</value>
ANei> � � � � � � � � � � � �</parameter>
ANei> � � � � � � � � � � � �<parameter>
ANei> � � � � � � � � � � � � � � � �<name>maxWait</name>
ANei> � � � � � � � � � � � � � � � �<value>10000</value>
ANei> � � � � � � � � � � � �</parameter>

ANei> � </ResourceParams>
ANei> </GlobalNamingResources>


ANei> <Context className="org.apache.catalina.core.StandardContext"
ANei> cachingAllowed="true"
ANei> � �charsetMapperClass="org.apache.catalina.util.CharsetMapper"
ANei> � �cookies="true" crossContext="false" debug="1" displayName="Apache-Axis"
ANei> docBase="our_application"
ANei> � �mapperClass="org.apache.catalina.core.StandardContextMapper"
ANei> path="/our_application" privileged="false"
ANei> � �reloadable="false" swallowOutput="false" useNaming="true"
ANei> wrapperClass="org.apache.catalina.core.StandardWrapper">
ANei> � � � � <Logger className="org.apache.catalina.logger.FileLogger"
ANei> prefix="localhost_our_application_log." suffix=".txt"
ANei> � � � � � � � � timestamp="true"/>

ANei> � <ResourceLink global="jdbc/myoracle" name="database"/>
ANei> </Context>

ANei> In your Context you have to put ResourceLink global tag.
ANei> The global attribute of the tag refers to the ResourceParam defined up in the
ANei> <GlobalNamingResources>
ANei> The name attribute of the tag refers to the lookup name used to get the
ANei> Datasource for your Connections

ANei> � javax.naming.InitialContext initContext = new javax.naming.InitialContext();
ANei> �javax.sql.DataSource dataSource =
ANei> � �(javax.sql.DataSource) initContext.lookup(
ANei> � � "java:comp/env/database");
ANei> �Connection con = dataSource.getConnection();


ANei> Didier Wiroth <[EMAIL PROTECTED]>
ANei> 04/11/2003 06:06 PM
ANei> Please respond to "Tomcat Users List"

ANei> �To: "'Tomcat Users List'" <[EMAIL PROTECTED]>
ANei> cc:
ANei> bcc:
ANei> Subject: RE: Tomcat oracle 9 question



ANei> Some more info
ANei> The webapplication log file is claiming about this:
ANei> Apache Tomcat/4.1.27
ANei> WebappClassLoader:
ANei> validateJarFile(/usr/local/jakarta-tomcat4.1/webapps/ourapplication/WEB-INF/
ANei> lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3,
ANei> NoKey
ANei> getDataType=javax.naming.NameNotFoundException: Name NoKey is not bound in
ANei> this Context
ANei> NoKey
ANei> - (null) : �javax.naming.NameNotFoundException: Name NoKey is not bound in
ANei> this Context
ANei> NoKey
ANei> getDataType=javax.naming.NameNotFoundException: Name NoKey is not bound in
ANei> this Context
ANei> NoKey
ANei> Stopping service Tomcat-Standalone
ANei> Starting service Tomcat-Standalone
ANei> Apache Tomcat/4.1.27
ANei> WebappClassLoader:
ANei> validateJarFile(/usr/local/jakarta-tomcat4.1/webapps/ourapplication/WEB-INF/
ANei> lib/servlet.jar) - jar not loaded. See Servlet Spec 2.3,
ANei> NoKey
ANei> getDataType=javax.naming.NameNotFoundException: Name NoKey is not bound in
ANei> this Context
ANei> NoKey
ANei> - (null) : �javax.naming.NameNotFoundException: Name NoKey is not bound in
ANei> this Context


>> -----Original Message-----
>> From: Edson Alves Pereira [mailto:[EMAIL PROTECTED]
>> Sent: 04 November 2003 18:40
>> To: 'Tomcat Users List'
>> Subject: RE: Tomcat oracle 9 question
>>
>>
>> You must put your Oracle driver in common/lib also,
>> where tomcat will try to find for its only use. Do that and
>> tell us if went everything ok.
>>
>> > ----------
>> > De: Didier Wiroth[SMTP:[EMAIL PROTECTED]
>> > Responder: Tomcat Users List
>> > Enviada: ter�a-feira, 4 de novembro de 2003 12:11
>> > Para: [EMAIL PROTECTED]
>> > Assunto: Tomcat oracle 9 question
>> >
>> > Hi,
>> >
>> > We have windows 2000 server running oracle 9.2.0.1.
>> >
>> > I've installed a freebsd machine running tomcat 4.1.27
>> which has the
>> > following config in server.xml: ------------start
>> > snip------------------ <Context
>> > className="org.apache.catalina.core.StandardContext"
>> > cachingAllowed="true"
>> >
>> > charsetMapperClass="org.apache.catalina.util.CharsetMapper"
>> > cookies="true" crossContext="false" debug="1"
>> > � � � � � � � � � � �displayName="Apache-Axis"
>> > docBase="our_application"
>> > mapperClass="org.apache.catalina.core.StandardContextMapper"
>> > � � � � � � � � � � �path="/our_application" privileged="false"
>> > reloadable="false" swallowOutput="false" useNaming="true"
>> >
>> > wrapperClass="org.apache.catalina.core.StandardWrapper">
>> > � � � � � � � � <Logger
>> > className="org.apache.catalina.logger.FileLogger"
>> > prefix="localhost_our_application_log." suffix=".txt"
>> > � � � � � � � � � � � � timestamp="true"/>
>> > � � � � � � � � <Resource name="jdbc/myoracle" auth="Container"
>> > type="javax.sql.DataSource"/>
>> > � � � � � � � � � � � � <ResourceParams name="jdbc/myoracle">
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>factory</name>
>> >
>> > <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>driverClassName</name>
>> >
>> > <value>oracle.jdbc.driver.OracleDriver</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>url</name>
>> >
>> > <value>jdbc:oracle:thin:@ourserver:1521:ourdatabase</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>username</name>
>> > � � � � � � � � � � � � � � � � � � � � <value>xyz</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>password</name>
>> > � � � � � � � � � � � � � � � � � � � � <value>xyz</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>maxActive</name>
>> > � � � � � � � � � � � � � � � � � � � � <value>80</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>maxIdle</name>
>> > � � � � � � � � � � � � � � � � � � � � <value>40</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � � � � � � � � � <parameter>
>> > � � � � � � � � � � � � � � � � � � � � <name>maxWait</name>
>> > � � � � � � � � � � � � � � � � � � � � <value>10000</value>
>> > � � � � � � � � � � � � � � � � </parameter>
>> > � � � � � � � � </ResourceParams>
>> > � � � � </Context>
>> > --------------end snip -----------------
>> > I've installed the jdk1.4 oracle 9.2.0.1 jdbc drivers in the
>> > webapplication WEB-INF/lib directory
>> > 1) ojdbc14.jar
>> > 2) ocrs12.zip (which I also copied to ocrs12.jar to be sure both are
>> > present)
>> >
>> > The web.xml of the webapplication has the following lines:
>> > -----------------start snip-----------------
>> > <resource-ref>
>> > <description>mysql connection</description>
>> > <res-ref-name>jdbc/myoracle</res-ref-name>
>> > <res-type>javax.sql.DataSource</res-type>
>> > <res-auth>Container</res-auth>
>> > </resource-ref>
>> > -----------------stop snip--------------------
>> >
>> > Here is stdout.log
>> > --------------------start snip----------------
>> > Apache Tomcat/4.1.27
>> > WebappClassLoader:
>> >
>> validateJarFile(/usr/local/jakarta-tomcat4.1/webapps/ourdatabase/WEB-I
>> > NF/l
>> > ib
>> > /servlet.jar) - jar not
>> > loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
>> > javax/servlet/Servlet.class
>> > NoKey
>> > getDataType=javax.naming.NameNotFoundException: Name NoKey
>> is not bound in
>> > this Context
>> > NoKey
>> > - (null) : �javax.naming.NameNotFoundException: Name NoKey
>> is not bound in
>> > this Context
>> > -------------------------stop snip----------------
>> >
>> > Unfortunately it doesn't work :-( there are no database
>> connections.
>> > Do I also need to install an oracle 9i client (I don't hope because
>> > freebsd doesn't have an available client)
>> >
>> > Thanks for any kind of help
>> > Didier
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>>


ANei> ---------------------------------------------------------------------
ANei> To unsubscribe, e-mail: [EMAIL PROTECTED]
ANei> For additional commands, e-mail: [EMAIL PROTECTED]



ANei> ---------------------------------------------------------------------
ANei> To unsubscribe, e-mail: [EMAIL PROTECTED]
ANei> For additional commands, e-mail: [EMAIL PROTECTED]



-- 
Best regards,
 Andrey                            mailto:[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to