Hello Andrey,

Wednesday, November 5, 2003, 12:39:17 AM, you wrote:

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

ARun> Any suggestions would be great !

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

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

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

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

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


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

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

ARun> � </ResourceParams>

ARun> </GlobalNamingResources>


ARun> And   Context lines

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

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

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

ARun>         </Context>

ARun> And it does not WORKS . :(


ARun> Thank you very very much!!!

ARun>  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