atom feed51 messages in org.apache.tomcat.usersRe: DBCP Woes!
FromSent OnAttachments
Peng AnnieOct 28, 2002 3:57 am 
Shapira, YoavOct 28, 2002 6:02 am 
Robert L SowdersOct 28, 2002 12:58 pm 
Shapira, YoavOct 28, 2002 1:07 pm 
Ricky LeungOct 28, 2002 3:22 pm 
Craig R. McClanahanOct 28, 2002 3:48 pm 
Craig R. McClanahanOct 28, 2002 4:15 pm 
nealOct 28, 2002 4:24 pm 
nealOct 28, 2002 4:55 pm 
Mike JacksonOct 28, 2002 4:55 pm 
nealOct 28, 2002 4:58 pm 
Robert L SowdersOct 28, 2002 5:42 pm 
Robert L SowdersOct 28, 2002 5:50 pm 
Bill BarkerOct 28, 2002 11:13 pm 
Peng AnnieOct 29, 2002 12:27 am 
David TildesleyOct 29, 2002 12:39 am 
Robert L SowdersOct 29, 2002 12:57 am 
Robert L SowdersOct 29, 2002 1:04 am 
Peng AnnieOct 29, 2002 1:08 am 
Robert L SowdersOct 29, 2002 2:01 am 
Mike JacksonOct 29, 2002 3:24 pm 
nealOct 29, 2002 3:39 pm 
Mike JacksonOct 29, 2002 3:43 pm 
Mike JacksonOct 29, 2002 4:02 pm 
micaelOct 29, 2002 4:05 pm 
nealOct 29, 2002 4:21 pm 
nealOct 29, 2002 4:31 pm 
nealOct 29, 2002 4:52 pm 
Iain SandersonOct 29, 2002 4:57 pm 
micaelOct 29, 2002 5:08 pm 
nealOct 29, 2002 5:15 pm 
Brandon CruzOct 29, 2002 5:17 pm 
nealOct 29, 2002 5:35 pm 
V. CekvenichOct 29, 2002 5:37 pm 
nealOct 29, 2002 5:43 pm 
nealOct 29, 2002 6:20 pm 
nealOct 29, 2002 6:47 pm 
Jacob KjomeOct 29, 2002 9:00 pm 
Craig R. McClanahanOct 29, 2002 10:15 pm 
nealOct 30, 2002 1:34 am 
Reynir HübnerOct 30, 2002 2:17 am 
Luc SanteramoOct 30, 2002 2:21 am 
nealOct 30, 2002 2:21 am 
nealOct 30, 2002 3:14 am 
omar...@telebahiacelular.com.brOct 30, 2002 3:50 am 
Tim FunkOct 30, 2002 3:54 am 
nealOct 30, 2002 4:40 am 
Mike JacksonOct 30, 2002 8:55 am 
Mike JacksonOct 30, 2002 8:58 am 
Craig R. McClanahanOct 30, 2002 9:50 am 
nealOct 30, 2002 1:10 pm 
Subject:Re: DBCP Woes!
From:V. Cekvenich (vi@users.sourceforge.net)
Date:Oct 29, 2002 5:37:17 pm
List:org.apache.tomcat.users

Try this code:
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/basicportal/basicportal_07/src/basicWebLib/org/commons/DAO/BasicDAOImpl.java?rev=1.3&content-type=text/vnd.viewcvs-markup

.V

neal wrote:

Oh yeah, and this is the source code for creating a connection:

protected Connection getConnection() throws NamingException, SQLException, Exception { this.CONTEXT = new InitialContext(); Connection conn = null; if(this.CONTEXT == null ) throw new Exception("Context needed to establish conection"); DataSource ds = (DataSource)CONTEXT.lookup("java:comp/env/jdbc/" + this.DATABASE);

if (ds != null) { conn = ds.getConnection(); }else{ return null; } return conn; }

So it would appear it is blowing up on the line where its attempting to create datasource. I read another Deja post not too long ago where someone was saying that this error is often caused by not having the right context path reference in the code for creating a Datasource. Someone else said that you must define your datasource via the web.xml and then its avail for reference. BUT, why was it working before (and why is it still working on my laptop) with out the web.xml reference, and with these exact context paths?

So confusing. :(

-----Original Message----- From: neal [mailto:neal@yahoo.com] Sent: Tuesday, October 29, 2002 5:16 PM To: Tomcat Users List Subject: RE: DBCP Woes!

My setup? I'm using MySQL 3.23 and the latest version of (don't recall the number) Connector/J for my driver. This is of course all sitting inside tomcat 4.0.4. I have manually installed the DBCP, collections and whatever other support classes I needed for DBCP.

I have configured DBCP via my server.xml file as such (below). When I was recieving the error from (org.hsql) that was because I was also attempting to creating a reference to the resource within my web.xml file. I have since removed it and that error has ceased. The error I am currently experiencing (javax.naming.NameNotFoundException: Name jdbc is not bound in this Context) was happening last night. *Seemed* to spontaneously got away, then this morning I loaded a few classes and rebooted and it started again. I have since removed those classes but the error is persisting.

Its worth noting that I can still obtain connections directly through JDBC, without the use of DBCP, no problem.

Please let me know if you can think of anything!!!!

Thanks! Neal

<Context path="" docBase="" debug="5">

<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="dbcp_" suffix=".log" timestamp="true" />

<Resource name="jdbc/hotel" auth="Container" type="javax.sql.DataSource" /> <ResourceParams name="jdbc/hotel"> <parameter> <name>factory</name> <value>org.apache.commons.dbcp.BasicDataSourceFactory</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>username</name> <value>xxxxx</value> </parameter> <parameter> <name>password</name> <value>xxxxx</value> </parameter> <parameter> <name>driverClassName</name> <value>com.mysql.jdbc.Driver</value> </parameter> <parameter> <name>url</name> <value>jdbc:mysql:///hotel</value> </parameter> <!-- <parameter> <name>removeAbandoned</name> <value>true</value> </parameter> <parameter> <name>removeAbandonedTimeout</name> <value>30</value> </parameter> <parameter> <name>logAbandoned</name> <value>true</value> </parameter> --> </ResourceParams>

</Context>

-----Original Message----- From: micael [mailto:cara@harbornet.com] Sent: Tuesday, October 29, 2002 4:06 PM To: Tomcat Users List Subject: RE: DBCP Woes!

I don't know your setup at all, neal, but this is a hypersonic database reference. What is your setup?

At 04:31 PM 10/29/2002 -0800, you wrote:

I considered poolman but it doesn't look like its supported or even available from the website to download anymore. Is this the case? I have heard good things about it.

Don't suppose you understand this JDBC conext binding error, do you?

Thanks. Neal

-----Original Message----- From: Mike Jackson [mailto:mjac@cdi-hq.com] Sent: Tuesday, October 29, 2002 3:25 PM To: Tomcat Users List Subject: RE: DBCP Woes!

Poolman works nicely, I have little to no problems with it. Then again I haven't used DBCP. But you'd still have had the exhasted connections problem with poolman.

--mikej -=----- mike jackson mjac@cdi-hq.com

-----Original Message----- From: neal [mailto:neal@yahoo.com] Sent: Tuesday, October 29, 2002 4:22 PM To: Tomcat Users List Subject: RE: DBCP Woes!

Now I have some other strange error related to accessing my database. Ever since I started messing with thsi stuff my conneciton to my dB has been flakey at best. Sometimes it works ... sometimes it doesn't.

javax.naming.NamingException: Exception creating DataSource: org.hsql.jdbcDriver

I don't even know where this class is defined or called!!!

:(

Neal

Still having DBCP problems.

I ensured that all my connections, statements, and resulset objects are being properly released when using DBCP for connection pooling. I've enabled recoverAbandoned. It seems that yes I did have some connection pool leaking, but that has since been resolved. But I still get this message (along with a failure) from time to time. Does anyone know why?

javax.naming.NameNotFoundException: Name jdbc is not bound in this

Context

This is a different message than I was getting when I was having

problems

with the DBCP pool being exhausted.

<mailto:tomc@jakarta.apache.org> For additional commands, e-mail: <mailto:tomc@jakarta.apache.org>

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

-- To unsubscribe, e-mail:

<mailto:tomc@jakarta.apache.org>

For additional commands, e-mail:

<mailto:tomc@jakarta.apache.org>

Micael

-------------------------------------------------------