tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Drnek" <Jonathan.Dr...@Haworth.com>
Subject RE: Tomcat 5 and oracle
Date Thu, 11 Dec 2003 18:30:10 GMT
I've been spending some time RTFM with out much progress.

I don't know if it matters but my data source is setup under GlobalNamingResources

I do not have any context defined in server.xml  instead I have the context in a file at conf/Catalina/localhost/metrology2.xml
and it looks like

<Context debug="9" displayName="Metrology Lab" docBase="metrology2" path="/metrology2">
  <Loader className="org.apache.catalina.loader.WebappLoader" debug="9"/>
  <Logger className="org.apache.catalina.logger.FileLogger" debug="9" prefix="metrology2"
suffix=".txt" timestamp="true" verbosity="4"/>
  <Resource auth="Container" description="Oracle Datasource example" name="jdbc/ordt" type="javax.sql.DataSource"/>
</Context> 

I didn't actually create it.  Tomcat must have created it for me.

Web.xml is located in webapps/metrology2/WEB-INF and looks like

<Context debug="9" displayName="Metrology Lab" docBase="metrology2" path="/metrology2">
  <Loader className="org.apache.catalina.loader.WebappLoader" debug="9"/>
  <Logger className="org.apache.catalina.logger.FileLogger" debug="9" prefix="metrology2"
suffix=".txt" timestamp="true" verbosity="4"/>
  <Resource auth="Container" description="Oracle Datasource example" name="jdbc/ordt" type="javax.sql.DataSource"/>
</Context>

My default server.xml got overwritten when I was playing around with the admin tool and now
looks like:

<?xml version='1.0' encoding='utf-8'?>
<Server>
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"/>
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
  <GlobalNamingResources>
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    <Resource auth="Container" description="User database that can be updated and saved"
name="UserDatabase" type="org.apache.catalina.UserDatabase"/>
    <Resource auth="Container" description="orderline test database" name="jdbc/ordt" 
scope="Shareable" type="javax.sql.DataSource"/>
    <ResourceParams name="UserDatabase">
      <parameter>
        <name>factory</name>
        <value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
      </parameter>
      <parameter>
        <name>pathname</name>
        <value>conf/tomcat-users.xml</value>
      </parameter>
    </ResourceParams>
    <ResourceParams name="jdbc/ordt">
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:oracle:thin:@holl302h:1521:ORDT</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>junk</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>4</value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>oracle.jdbc.driver.OracleDriver</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>ordline</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>2</value>
      </parameter>
    </ResourceParams>
  </GlobalNamingResources> 
  <Service name="Catalina">
    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"
port="8080" redirectPort="8443">
    </Connector>
    <Connector port="8009" protocol="AJP/1.3" protocolHandlerClassName="org.apache.jk.server.JkCoyoteHandler"
redirectPort="8443">
    </Connector>
    <Engine defaultHost="localhost" name="Catalina">
      <Host appBase="webapps" name="localhost">
        <Logger className="org.apache.catalina.logger.FileLogger" prefix="localhost_log."
suffix=".txt" timestamp="true"/>
      </Host>
      <Logger className="org.apache.catalina.logger.FileLogger" prefix="catalina_log."
suffix=".txt" timestamp="true"/>
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"/>
    </Engine>
  </Service>
</Server>

I found a JSP page that will display my JNDI recources and here is part of what that shows

* Context: java:/ 
o Context: java:/comp 
* UserTransaction => Reference Class Name: javax.transaction.UserTransaction Reference
type: javax.transaction.UserTransaction
* Context: java:/comp/env 
* Context: java:/comp/env/jdbc 
* ordt => org.apache.commons.dbcp.BasicDataSource@1014e21 
Url - null
DriverClassName - null
Username - null
Password - null
ValidationQuery - null
NumActive - 0
NumIdle - 0


Back to the docs....

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message