tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Donaghy <micha...@michaeldonaghy.com>
Subject Tomcat4.0.2 + JNDI jdbc + warp
Date Sun, 24 Feb 2002 01:40:16 GMT
I've got a very simple servlet that gets a pooled JDBC connection to
MySQL that works just fine when I use :8080.  When using :80 with an
appache warp connection to tomcat, I can't get the connection.

I don't know much about JNDI, so that might be the source of my
problems.  Any and all help is greatly appreciated.

Michael



Relevant Code:

    Context initCtx = new InitialContext();
    Context envCtx = (Context) initCtx.lookup("java:comp/env");
    Object ds = envCtx.lookup("jdbc/ResumeDB");
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                returns null on :80, but not :8080
WEB-INF/web.xml
    <resource-ref>
      <description>Resource reference for database</description>
      <res-ref-name>jdbc/ResumeDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>

conf/server.xml
        <Context path="/resume" docBase="resume" debug="0" reloadable="true" crossContext="true">
          <Resource name="jdbc/ResumeDB" auth="Container" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/ResumeDB">
            <parameter>
              <name>user</name>
              <value>********</value>
             </parameter>
            <parameter>
              <name>password</name>
              <value>********</value>
             </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>org.gjt.mm.mysql.Driver</value>
             </parameter>
            <parameter>
              <name>driverName</name>
              <value>jdbc:mysql://localhost:3306/********</value>
             </parameter>
          <Logger className="org.apache.catalina.logger.FileLogger"
                  prefix="localhost_resume_log." suffix=".txt"
                  timestamp="true" />
        </Context>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message