commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Millett <...@ec-group.com>
Subject [jdbc2pool] Database "" does not exist in the system catalog ????
Date Thu, 20 Jun 2002 18:56:33 GMT
I am running tomcat 4.1.3-b, latest cvs co (this am) of commons-sandbox
(commons-lang-1.0-dev.jar, jdbc2pool-4.1.jar, commons-pool.jar, &
commons-dbcp.jar) on a redhat 7.2, jdk build 1.4.0_01-b03.

My server.xml cruft is: (inside of the /examples context)
<!-- TROPICOSDB -->
<Resource name="jdbc/tropicosDB" 
          auth="Container" 
         type="org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS"/>
    <ResourceParams name="jdbc/tropicosDB">
      parameter><name>factory</name>
            
<value>org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS</value>
            </parameter>
        <parameter><name>maxActive</name><value>100</value></parameter>
        <parameter><name>maxIdle</name><value>30000</value></parameter>
        <parameter><name>maxWait</name><value>100</value></parameter>
        <parameter><name>user</name><value>XXXXXX</value></parameter>
        <parameter><name>password</name><value>XXXXX</value></parameter>
        <parameter>
            <name>driver</name>
            <value>org.postgresql.Driver</value></parameter>
        <parameter>
             <name>url</name>
             <value>jdbc:postgresql://vlad:5432/tropicos</value>
        </parameter>
   </ResourceParams>
<!-- TROPICOS -->
<Resource name="jdbc/tropicos" auth="Container" 
         type="org.apache.commons.jdbc2pool.Jdbc2PoolDataSource"/>
     <ResourceParams name="jdbc/tropicos">
        <parameter><name>factory</name>           
<value>org.apache.commons.jdbc2pool.Jdbc2PoolDataSource</value>
        </parameter>
        <parameter><name>dataSourceName</name>
                  <value>java:comp/env/jdbc/tropicosDB</value>
        </parameter>
<parameter><name>defaultMaxConnections</name><value>30</value></parameter>
<parameter><name>maxExpiryTime</name><value>3600</value></parameter>
<parameter><name>connectionWaitTimeout</name><value>10</value></parameter>
<parameter><name>logInterval</name><value>10</value></parameter>
</ResourceParams>
<!-- END JDBC/JNDI -->

OK, now in the web.xml in the /examples/WEB-INF dir I have:
    <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/tropicosDB</res-ref-name>
     
<res-type>org.apache.commons.jdbc2pool.adapter.DriverAdapterCPDS</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    <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/tropicos</res-ref-name>
     
<res-type>org.apache.commons.jdbc2pool.Jdbc2PoolDataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>


OK, I now try to access a servlet DBDumperPool where this section of
code causes an error:
        Context initCtx = new InitialContext();
        Context envCtx = (Context) initCtx.lookup("java:comp/env");
        DataSource ds = (DataSource)envCtx.lookup("jdbc/tropicos");
        // Connect to database
		out.println("<h1>Connecting to Database JNI Context =
jdbc/tropicos</h1>");
        Connection conn = ds.getConnection();
		out.println("<h1>Connected...Now creating a statement</h1>");
		st = conn.createStatement();


The error is:
java.lang.RuntimeException: Backend start-up failed: FATAL 1:  Database
"tropicos" does not exist in the system catalog.

	at
org.apache.commons.jdbc2pool.KeyedCPDSConnectionFactory.makeObject(KeyedCPDSConnectionFactory.java:173)
	at
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(Unknown
Source)
	at
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:879)
	at
org.apache.commons.jdbc2pool.Jdbc2PoolDataSource.getConnection(Jdbc2PoolDataSource.java:821)
	at DBDumperPool.testDB(DBDumperPool.java:105)
	at DBDumperPool.doGet(DBDumperPool.java:29)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)


Line 105 is Connection conn = ds.getConnection();.


I've tried real hard to understand how to setup the jdbc2pool package
with tomcat.  I do not know what a KeyedCPDSConnection is.

What is the correct steps?

Any hints, ideas, etc would be very helpful.

Thanks.
-- 
Brian Millett                    
Enterprise Consulting Group     "Shifts in paradigms
(314) 205-9030                     often cause nose bleeds."
bpm@ec-group.com                   Greg Glenn


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message