DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20991>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20991

Connection Pool : Datasource cannot retrieve connection.

           Summary: Connection Pool : Datasource cannot retrieve connection.
           Product: Tomcat 4
           Version: 4.1.18
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hi,
I have tomcat 4.1.18 on a win2k. I setup a db-pool with the basic tags within 
the context(see-reference 1 below) and then added resource ref elements(see-
reference 2 below) in the web.xml file. 
 
Logger("State 1");
Context ctx = new InitialContext();
Logger("State 2");
DataSource ds =(DataSource)ctx.lookup("java:comp/env/jdbc/jjcp);
Logger("State 3 " +ds);
connection= ds.getConnection();


Output:
State 1
State 2
State 3 [EMAIL PROTECTED]

(and then no response)

It retrieves the datasource, but when it tries fetching a connection, there is 
no response back. I checked on mysql end, and it showed new process being 
created and dumped(status:login/freeing items). So, the connection-pool was 
infact active. However, the datasource never returns with the connection. I 
have got the mysql-connector-java-3.0.8-stable-bin.jar and jdbc2_0-stdext.jar 
in the TOMCAT_HOME/common/lib directory and I dont see why, this should be a 
classloader issue.

Reference
1.-------------------------------------------------
         <Resource name="jdbc/jjcp" auth="Container" 
type="javax.sql.DataSource"/>
 <ResourceParams name="jdbc/jjcp">
      <parameter>
        <name>validationQuery</name>
        <value></value>
      </parameter>
      <parameter>
        <name>maxWait</name>
        <value>5000</value>
      </parameter>
      <parameter>
        <name>maxActive</name>
        <value>1</value>
      </parameter>
      <parameter>
        <name>password</name>
        <value>password</value>
      </parameter>
      <parameter>
        <name>url</name>
        <value>jdbc:mysql://localhost:3306/mysql</value>
      </parameter>
      <parameter>
        <name>driverClassName</name>
        <value>com.mysql.jdbc.Driver</value>
      </parameter>
      <parameter>
        <name>maxIdle</name>
        <value>1</value>
      </parameter>
      <parameter>
        <name>username</name>
        <value>root</value>
      </parameter>
      <parameter>
        <name>factory</name>
        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
      </parameter>
    </ResourceParams>

2.-------------------------------------------------

   <resource-ref>
      <description>
         Resource reference to a factory for java.sql.Connection
         instances that may be used for talking to a particular
         database that is configured in the server.xml file.
      </description>
      <res-ref-name>
         jdbc/jjcp
      </res-ref-name>
      <res-type>
         javax.sql.DataSource
      </res-type>
      <res-auth>
         Container
      </res-auth>
   </resource-ref>

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

Reply via email to