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

�<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="jdbc/myoracle" 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>
</GlobalNamingResources>


<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"/>

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

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

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


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

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



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


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


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



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

Reply via email to