tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liem Do" <l...@waterware.com>
Subject Re: DefaultContext problem migrating to Tomcat 4.1.24
Date Mon, 05 May 2003 22:04:40 GMT
You could put all your data sources within <GlobalNamingResources> tags in
server.xml to make them accessible to all webapps.

hth
--liem

----- Original Message -----
From: "Victor Popiol" <vpopiol@douwantit.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Monday, May 05, 2003 2:54 PM
Subject: DefaultContext problem migrating to Tomcat 4.1.24


Hi. As I'm trying to migrate from 4.0.4 to 4.1.24 I realized that data
sources defined within the DefaultContext are not available for servlets
loaded at startup. This is forcing me to duplicate data source
definitions for each web application. This is not practical.

Has anybody noted this? I have seen some similar yet unanswered posts in
this list.

I get the following error in the log:
NamingException Looking up context
Name jdbc is not bound in this Context

Here is an abbreviated version of my server.xml:

<Server className="org.apache.catalina.core.StandardServer" debug="0"
port="8005" shutdown="SHUTDOWN">
    <Engine className="org.apache.catalina.core.StandardEngine"
debug="0" defaultHost="localhost"
mapperClass="org.apache.catalina.core.StandardEngineMapper"
name="Standalone">
      <Host className="org.apache.catalina.core.StandardHost"
appBase="webapps" autoDeploy="true"
configClass="org.apache.catalina.startup.ContextConfig"
contextClass="org.apache.catalina.core.StandardContext" debug="0"
deployXML="true"
errorReportValveClass="org.apache.catalina.valves.ErrorReportValve"
liveDeploy="true"
mapperClass="org.apache.catalina.core.StandardHostMapper"
name="localhost" unpackWARs="true">
        <DefaultContext
className="org.apache.catalina.core.StandardDefaultContext"
cookies="true" crossContext="false" name="defaultContext"
reloadable="false" swallowOutput="false" useNaming="true"
wrapperClass="org.apache.catalina.core.StandardWrapper">
          <Resource name="jdbc/duwi" scope="Shareable"
type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/duwi">
            <parameter>
              <name>validationQuery</name>
              <value>select sysdate from dual</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>5000</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>20</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>xxxxxxxx</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:oracle:thin:@server:1521:ORCL</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>oracle.jdbc.driver.OracleDriver</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>2</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>xxxxxx</value>
            </parameter>
          </ResourceParams>
        </DefaultContext>
      </Host>
    </Engine>
  </Service>
</Server>

Regards
Victor Popiol
Chief Technology Officer & Co-Founder
DoUWantIt.com
Ph: 954-862-0020



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