org.apache.commons.dbcp.DbcpException: java.sql.SQLException

2005-06-13 Thread ajay kumar
Hi Everybody,

  This is Ajay Kumar.I implemented DBCP through tomcat
container.Some times when i run the webpages it is giving the
following Exception:

org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server
connection failure during transaction. Attempted reconnect 3 times.
Giving up

  I think it is the problem with the values which are
mentioned in the server.xml for DBCP.Here are the details of
server.xml

parameter
   namemaxActive/name
   value100/value
/parameter
parameter
   namemaxIdle/name
   value20/value
/parameter
parameter
  namemaxWait/name
  value1/value
/parameter
parameter
   nameremoveAbandoned/name
   valuetrue/value
/parameter
parameter
   nameremoveAbandonedTimeout/name
   value300/value
/parameter
parameter
namelogAbandoned/name
valuetrue/value
/parameter

 If any body know the solution please mail me the
details.Thanks in advance...
   
-- Ajay

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



Getting DBCP Exception

2005-06-13 Thread ajay kumar
Hi Everybody,

 This is Ajay Kumar.I implemented DBCP through tomcat
container.Some times when i run the webpages it is giving the
following Exception:

org.apache.commons.dbcp.DbcpException: java.sql.SQLException: Server
connection failure during transaction. Attempted reconnect 3 times.
Giving up

 I think it is the problem with the values which are
mentioned in the server.xml for DBCP.Here are the details of
server.xml

parameter
  namemaxActive/name
  value100/value
/parameter
parameter
  namemaxIdle/name
  value20/value
/parameter
parameter
 namemaxWait/name
 value1/value
/parameter
parameter
  nameremoveAbandoned/name
  valuetrue/value
/parameter
parameter
  nameremoveAbandonedTimeout/name
  value300/value
/parameter
parameter
   namelogAbandoned/name
   valuetrue/value
/parameter

If any body know the solution please mail me the
details.Thanks in advance...

-- Ajay


-- 
Ajay

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



Re: still not clear with connection pooling in tomcat

2005-04-11 Thread ajay kumar
Hi   
   I also struggled for the Tomcat Connection Pooling problem for
one week and i got the solution.

write the follwing code snippets in respective files:

-web.xml--
 resource-ref
   res-ref-namejdbc/TestDB/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
/resource-ref

--server.xml---
write the following code in server.xml in Context tag
Resource
name=jdbc/TestDB
auth=Container
type=javax.sql.DataSource/
ResourceParams name=jdbc/TestDB
parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
/parameter
parameter
namedriverClassName/name
valuewriter the driver class which you are using/value
/parameter
parameter
nameurl/name
valuewrite the url here/value
/parameter
parameter
nameusername/name
value/value
/parameter
parameter
namepassword/name
value/value
/parameter
parameter
namemaxActive/name
value20/value
/parameter
parameter
namemaxIdle/name
value10/value
/parameter
parameter
namemaxWait/name
value-1/value
/parameter
parameter
nameremoveAbandoned/name
valuetrue/value
/parameter
parameter
nameremoveAbandonedTimeout/name
value300/value
/parameter
parameter
namelogAbandoned/name
valuetrue/value
/parameter
/ResourceParams

and also add the following code in the file in which you are using
database code and import javax.naming.* and javax.sql.* packages..

 Context ctx=new InitialContext();
 DataSource ds=(DataSource)ctx.lookup(java:/comp/env/jdbc/TestDB);
 Connection con=ds.getConnection();  
 Statement st = con.createStatement(); 

Make sure that commons-dbcp,commons-collections and commons-pool files
in common/lib directory.
 I hope that this mail will help you in finding out the solution.

regards,

-Ajay Kumar

On Apr 10, 2005 1:20 AM, Krishnakant Mane [EMAIL PROTECTED] wrote:
 thanks a lot doug,
 if I have any problem I will trouble again.
 just a couple of questions.
 there were two parameters in the email you sent the
 other day.
 I did not get the meaning of those parameters stating
 that active connections should be 100 and the other
 with 30 as the value.
 what is the difference between max active and inactive
 connections?
 and just a curious question,
 is tomcat really used on heavy duty commertial
 websites?
 thanks
 Krishnakant.
 
 Send instant messages to your online friends http://uk.messenger.yahoo.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-- 
Ajay

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



How to check whether session has expired or not

2005-04-11 Thread ajay kumar
Hi Friends
 
  I am developing e-commerce based web applications,I want to
check whether user session has expired, so that i will display Your
session has expired message to the user.So how to find out that
session expiry. This is very important as i am  doing e-commerce
apllications.
   
Regards
 --Ajay Kumar

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



Facing problem with implementation of DBCP

2005-03-28 Thread ajay kumar
Hi All,

Iam facing problem with DBCP implementation
from last one week.I followed all the instructions
which are mentioned in the documentation section,but i
could not implement it.
 When i run the Program which is involving
DBCP, is showing the following error: 
java.sql.SQLException: Cannot load JDBC driver
class 'null' .
Normal JDBC Programs are working fine.I placed
all the three jar files and Jdbc Driver(Mysql
Connector) in $CATALINA_HOME/common/lib
folder.(commons-collections.jar,commons-dbcp.jar,
commons-pool.jar and
mysql-connector-java-3.1.7-bin.jar)
  
 The configuration which iam using is:
  
  Linux Operating System (Redhat v 8.0)
  Mysql(v 3.23)
  Mysql Connector(3.1.7)
  Tomcat 4.1.24
  J2sdk 1.4.1

 I will be very glad to you,if you can assist me
in resolving this issue.
-- 
Ajay

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