commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John McNally <jmcna...@collab.net>
Subject Re: [jdbc2pool] Database "" does not exist in the system catalog ????
Date Fri, 21 Jun 2002 16:43:44 GMT
I'm not sure on the 4.1 part either.  There has been no release of
jdbc2pool.  the jar should have the 1.0-dev modifier.  The tomcat code
is just the configuration code needed to use the pool within tomcat. 
Tomcat documentation shows several examples, the code Brian showed was
specific to jdbc2pool.

john mcnally

On Fri, 2002-06-21 at 06:16, Randy Speh wrote:
> Could you guys elaborate on where this tomcat code
> resides and where the jdbc2pool-4.1.jar is.  I've been
> using the jdbc2pool code a while now, but I'm not sure
> where besides Torque that the jdbc2pool code is used.
> 
> Thanks,
> Randy Speh
> 
> --- John McNally <jmcnally@collab.net> wrote:
> > I have a similar setup and it is working, it is
> > using mysql though.
> > Are you able to access the db using the driver
> > directly?  The error you
> > are seeing is coming from the database server, i
> > think.  The database
> > does not appear to be setup.
> > 
> > john mcnally  
> > 
> > 
> > On Thu, 2002-06-20 at 11:56, Brian Millett wrote:
> > > 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>
> > > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> > <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:commons-dev-help@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>
> 



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