Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
- Original Message - From: Thangavel Sankaranarayanan [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Monday, September 08, 2008 12:49 PM Subject: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); } theLog.debug(About to get a Connection from SharedPoolDatasrc and return it back...); return ds.getConnection(); } catch(Exception exp) { theLog.error(Exception while get a Datasource connection); theLog.error(exp); throw exp; } } Regards, Thangavel Sankaranarayanan Thangavel... what are the system details JRE and db driver version if you know... I've seen some wierd behaviour as well, but I think its the latest JDBC drivers on Java 6 that make a pool lose its connection... I'm not even using TC's pool, so I dont think its a TC thing, we saw something similar after upgrading Java... Stick this in your exception SQLException tmp = e; do {//Ever since Java 6 extra issues //This just to see what the hell is going on System.out.println(); System.out.println(createStatement failed: + e.toString()); tmp.printStackTrace(); tmp = tmp.getNextException(); } while (tmp != null); It will show you the exception that is causing the exception the real trouble ours was CONNECTION NOT FOUND Which means the driver is dropping connections in the pool... trouble is the pool doesnt know it... If you refresh, the pool gives you next connection, so that naturally works, until it cycles in on the bad dummy connection again... Maybe its the same thing... we went back to older drivers... other thing is that it wasnt Oracle either, but symptom is the same.. In our case exact same setup... on Java 5 perfect, on Java 6 broken... maybe? Good Luck --- HARBOR : http://www.kewlstuff.co.za/index.htm The most powerful application server on earth. The only real POJO Application Server. See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm --- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Hi, If this is not a problem with tomcat and it is something to do with application (or) or with java or 0racle!!Please suggest me for some user list!!! Thanks in Advance!! Regards, Thangavel Sankaranarayanan Thangavel Sankaranarayanan/ India/[EMAIL PROTECTED] To Tomcat Users List 09/08/2008 04:19 users@tomcat.apache.org PM cc Subject Please respond to Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); } theLog.debug(About to get a Connection from SharedPoolDatasrc and return it back...); return ds.getConnection(); } catch(Exception exp) { theLog.error(Exception while get a Datasource connection); theLog.error(exp); throw exp; } } Regards, Thangavel Sankaranarayanan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before returning one on ds.getConnection(), regenerating them if they fail. --David Thangavel Sankaranarayanan wrote: Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); } theLog.debug(About to get a Connection from SharedPoolDatasrc and return it back...); return ds.getConnection(); } catch(Exception exp) { theLog.error(Exception while get a Datasource connection); theLog.error(exp); throw exp; } } Regards, Thangavel Sankaranarayanan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Smith Programmer/Analyst College of Agriculture and Life Sciences Cornell University B32 Morrison Hall Ithaca, NY 14853 Phone: (607) 255-4521 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before returning one on ds.getConnection(), regenerating them if they fail. --David Thangavel Sankaranarayanan wrote: Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); } theLog.debug(About to get a Connection from SharedPoolDatasrc and return it back...); return ds.getConnection(); } catch(Exception exp) { theLog.error(Exception while get a Datasource connection); theLog.error(exp); throw exp; } } Regards, Thangavel Sankaranarayanan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- David Smith Programmer/Analyst College of Agriculture and Life Sciences Cornell University B32 Morrison Hall Ithaca, NY 14853 Phone: (607) 255-4521 - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
I've partially given it to you already. I'm assuming for the purposes of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the tomcat provided database pooling. Find the Resource ... / element in your webapp's context xml file where you defined your database pool and add an attribute named validationQuery with a value of select 1. Then restart your webapp. --David Thangavel Sankaranarayanan wrote: Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before returning one on ds.getConnection(), regenerating them if they fail. --David Thangavel Sankaranarayanan wrote: Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); } theLog.debug(About to get a Connection from SharedPoolDatasrc and return it back...); return ds.getConnection(); } catch(Exception exp) { theLog.error(Exception while get a Datasource connection); theLog.error(exp); throw exp; } } Regards, Thangavel Sankaranarayanan - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Hi David, Thanks !!! Is the validationQuery applicable to tomacat 4.x. I am using tomcat 4.x in windows2000 Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 09:19 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I've partially given it to you already. I'm assuming for the purposes of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the tomcat provided database pooling. Find the Resource ... / element in your webapp's context xml file where you defined your database pool and add an attribute named validationQuery with a value of select 1. Then restart your webapp. --David Thangavel Sankaranarayanan wrote: Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before returning one on ds.getConnection(), regenerating them if they fail. --David Thangavel Sankaranarayanan wrote: Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG au.com.vodafone.mpp.bos.MPPFactory - Exception:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read WARN org.apache.struts.action.RequestProcessor - Unhandled Exception thrown: class java.sql.SQLException This is my code: static public Connection getConnection() throws Exception { theLog.debug(Inside getConnection() method of DataScr); try { if (ds == null) { theLog.debug(SharedPoolDatasrc is NULL: Serious Error ); System.out.println(SERIOUS ERROR 99); }
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
I think so. Tomcat 4.1.x relies on DBCP 1.0 whose docs aren't readily available anymore. If you can find the source for DBCP 1.0, you could take a look in the source code and get that answer. Or you could just try it on your test system and see if it works. :-) The manner the validation query is added to tomat's config is different though. You add it in the ResourceParams element the same way other properties are defined in your version. --David Thangavel Sankaranarayanan wrote: Hi David, Thanks !!! Is the validationQuery applicable to tomacat 4.x. I am using tomcat 4.x in windows2000 Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 09:19 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I've partially given it to you already. I'm assuming for the purposes of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the tomcat provided database pooling. Find the Resource ... / element in your webapp's context xml file where you defined your database pool and add an attribute named validationQuery with a value of select 1. Then restart your webapp. --David Thangavel Sankaranarayanan wrote: Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before returning one on ds.getConnection(), regenerating them if they fail. --David Thangavel Sankaranarayanan wrote: Hi , I am getting the following error when connecting to oracle database, Has any one seen this kind of errors before? is this the problem with tomcat in loosing the connections?? I am getting this error once in 5 hrs and i get a HTTPStatus500 error and when a user tries again it gets okay and it is working How can i resolve this Intermitant DB Problem in tomcat!!! java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read This is the Exception details in my application logs: DEBUG au.com.vodafone.mpp.bos.MPPFactory - Calling getConnection method of Datasrc Class:600991 DEBUG au.com.vodafone.mpp.da.DataSrc - Inside getConnection() method of DataScr DEBUG au.com.vodafone.mpp.da.DataSrc - About to get a Connection from SharedPoolDatasrc and return it back... ERROR au.com.vodafone.mpp.da.DataSrc - Exception while get a Datasource connection ERROR au.com.vodafone.mpp.da.DataSrc - java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read DEBUG
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl connectionURL=ldap://vanja1234:389; digest=SHA roleBase=ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au roleName=cn roleSearch=(uniquemember={0}) roleSubtree=true userPassword=userPassword userPattern=uid={0},dc=abc,dc=com,dc=in / /Context Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 10:44 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I think so. Tomcat 4.1.x relies on DBCP 1.0 whose docs aren't readily available anymore. If you can find the source for DBCP 1.0, you could take a look in the source code and get that answer. Or you could just try it on your test system and see if it works. :-) The manner the validation query is added to tomat's config is different though. You add it in the ResourceParams element the same way other properties are defined in your version. --David Thangavel Sankaranarayanan wrote: Hi David, Thanks !!! Is the validationQuery applicable to tomacat 4.x. I am using tomcat 4.x in windows2000 Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 09:19 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I've partially given it to you already. I'm assuming for the purposes of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the tomcat provided database pooling. Find the Resource ... / element in your webapp's context xml file where you defined your database pool and add an attribute named validationQuery with a value of select 1. Then restart your webapp. --David Thangavel Sankaranarayanan wrote: Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Two questions: 1. Is the db server on the same box as the tomcat server? If not, have you ruled out network hardware issues between the db server and tomcat? 2. Does your db pool definition have the attribute validationQuery=select 1? That would pre-test your connections before
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Actually I believe tomcat 4.1 still predominantly used server.xml for context definitions. Take a look in there for a ResourceParams ... ... /ResourceParams element under your webapp's Context ... ... /Context element. I could be wrong about that -- it's been a *very* long time since I've done anything with that version. --David Thangavel Sankaranarayanan wrote: Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl connectionURL=ldap://vanja1234:389; digest=SHA roleBase=ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au roleName=cn roleSearch=(uniquemember={0}) roleSubtree=true userPassword=userPassword userPattern=uid={0},dc=abc,dc=com,dc=in / /Context Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 10:44 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I think so. Tomcat 4.1.x relies on DBCP 1.0 whose docs aren't readily available anymore. If you can find the source for DBCP 1.0, you could take a look in the source code and get that answer. Or you could just try it on your test system and see if it works. :-) The manner the validation query is added to tomat's config is different though. You add it in the ResourceParams element the same way other properties are defined in your version. --David Thangavel Sankaranarayanan wrote: Hi David, Thanks !!! Is the validationQuery applicable to tomacat 4.x. I am using tomcat 4.x in windows2000 Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 09:19 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I've partially given it to you already. I'm assuming for the purposes of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the tomcat provided database pooling. Find the Resource ... / element in your webapp's context xml file where you defined your database pool and add an attribute named validationQuery with a value of select 1. Then restart your webapp. --David Thangavel Sankaranarayanan wrote: Please help me in setting up a Validation Querry!!! I am not aware of it!! Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 06:24 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
David,Actually Resource element is used when we want to map a datascr to a JNDI Resource and call from aoos.But in my case there is no JNDI naming of datasource or database!! all parameters are hard coded . In that case wat can i do!!! I have modified my code slightly to look like ths!!! will this be helpfull??? catch(Exception exp) { theLog.error(Exception while getting a Datasource connection..Trying again...); theLog.error(exp); int i=1; do{ try{ return ds.getConnection(); } catch(Exception e){ theLog.error(Try:+i+Exception while getting a Datasource connection...); theLog.error(e); if(i==3) throw e; } i++ }while(i=3) } Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 11:51 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Actually I believe tomcat 4.1 still predominantly used server.xml for context definitions. Take a look in there for a ResourceParams ... ... /ResourceParams element under your webapp's Context ... ... /Context element. I could be wrong about that -- it's been a *very* long time since I've done anything with that version. --David Thangavel Sankaranarayanan wrote: Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl connectionURL=ldap://vanja1234:389; digest=SHA roleBase=ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au roleName=cn roleSearch=(uniquemember={0}) roleSubtree=true userPassword=userPassword userPattern=uid={0},dc=abc,dc=com,dc=in / /Context Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 10:44 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read I think so. Tomcat 4.1.x relies on DBCP 1.0 whose docs aren't readily available anymore. If you can find the source for DBCP 1.0, you could take a look in the source code and get that answer. Or you could just try it on your test system and see if it works. :-) The manner the validation query is added to tomat's config is different though. You add it in the ResourceParams element the same way other properties are defined in your version. --David Thangavel Sankaranarayanan wrote: Hi David, Thanks !!! Is the validationQuery applicable to tomacat 4.x. I am using tomcat 4.x in windows2000 Regards, Thangavel Sankaranarayanan
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
David, Ignore the previous code!!This is the right one:will this code make the difference? catch(Exception exp) { theLog.error(Exception while getting a Datasource connection..Trying again...); theLog.error(exp); int i=1; do{ try{ return ds.getConnection(); } catch(Exception e){ theLog.error(Try:+i+Exception while getting a Datasource connection...); theLog.error(e); if(i==3) throw e; } i++ }while(i=3) } Regards, Thangavel Sankaranarayanan Thangavel Sankaranarayanan/ India/[EMAIL PROTECTED] To Tomcat Users List 09/09/2008 12:16 users@tomcat.apache.org AM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read David,Actually Resource element is used when we want to map a datascr to a JNDI Resource and call from aoos.But in my case there is no JNDI naming of datasource or database!! all parameters are hard coded . In that case wat can i do!!! I have modified my code slightly to look like ths!!! will this be helpfull??? catch(Exception exp) { theLog.error(Exception while getting a Datasource connection..Trying again...); theLog.error(exp); int i=1; do{ try{ return ds.getConnection(); } catch(Exception e){ theLog.error(Try:+i+Exception while getting a Datasource connection...); theLog.error(e); if(i==3) throw e; } i++ }while(i=3) } Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 11:51 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Actually I believe tomcat 4.1 still predominantly used server.xml for context definitions. Take a look in there for a ResourceParams ... ... /ResourceParams element under your webapp's Context ... ... /Context element. I could be wrong about that -- it's been a *very* long time since I've done anything with that version. --David Thangavel Sankaranarayanan wrote: Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl
RE: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
any reason why you're not using DBCP ? if you dont mind using a connection pool take a look at examples provided at http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/doc/ManualPoolingDataSourceExample.java?revision=132018view=markup also if you want your instance variables to automatically map to DB columns I would suggest Hibernate http://www.ibm.com/developerworks/websphere/techjournal/0409_patil/0409_patil.html HTH Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Subject: Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read To: users@tomcat.apache.org From: [EMAIL PROTECTED] Date: Tue, 9 Sep 2008 00:16:17 +0530 David,Actually Resource element is used when we want to map a datascr to a JNDI Resource and call from aoos.But in my case there is no JNDI naming of datasource or database!! all parameters are hard coded . In that case wat can i do!!! I have modified my code slightly to look like ths!!! will this be helpfull??? catch(Exception exp) { theLog.error(Exception while getting a Datasource connection..Trying again...); theLog.error(exp); int i=1; do{ try{ return ds.getConnection(); } catch(Exception e){ theLog.error(Try:+i+Exception while getting a Datasource connection...); theLog.error(e); if(i==3) throw e; } i++ }while(i=3) } Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 11:51 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Actually I believe tomcat 4.1 still predominantly used server.xml for context definitions. Take a look in there for a ResourceParams ... ... /ResourceParams element under your webapp's Context ... ... /Context element. I could be wrong about that -- it's been a *very* long time since I've done anything with that version. --David Thangavel Sankaranarayanan wrote: Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl connectionURL=ldap://vanja1234:389; digest=SHA roleBase=ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au roleName=cn roleSearch=(uniquemember={0}) roleSubtree=true userPassword=userPassword userPattern=uid={0},dc=abc,dc=com,dc=in / /Context Regards, Thangavel Sankaranarayanan David Smith [EMAIL
Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read
Ok. Do you hold on to your connections across requests or close them at the end? If they are held, then it'd be a good idea to fire off a cheap and easy select 1 query before doing any work. If it throws an exception, close it up and get another. If on the other hand these connections are closed down at the end of each request, you should probably look at your network hardware between tomcat and the db server. Connection reset by peer can be caused by firewall hardware or failing switches in addition to the db server. --David Thangavel Sankaranarayanan wrote: David,Actually Resource element is used when we want to map a datascr to a JNDI Resource and call from aoos.But in my case there is no JNDI naming of datasource or database!! all parameters are hard coded . In that case wat can i do!!! I have modified my code slightly to look like ths!!! will this be helpfull??? catch(Exception exp) { theLog.error(Exception while getting a Datasource connection..Trying again...); theLog.error(exp); int i=1; do{ try{ return ds.getConnection(); } catch(Exception e){ theLog.error(Try:+i+Exception while getting a Datasource connection...); theLog.error(e); if(i==3) throw e; } i++ }while(i=3) } Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 11:51 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read Actually I believe tomcat 4.1 still predominantly used server.xml for context definitions. Take a look in there for a ResourceParams ... ... /ResourceParams element under your webapp's Context ... ... /Context element. I could be wrong about that -- it's been a *very* long time since I've done anything with that version. --David Thangavel Sankaranarayanan wrote: Hi David, In my webapps directory ,i can find Conext.xml (nameof context.xml).in my context.xml the following is defined.. where do i need to configure it ,David?? Context path=/mpp docBase=D:/projects/mpp/dealer/release071010 debug=0 privileged=true Realm className=au.com.workconsult.catalina.realm.NdsJNDIRealm debug=99 connectionName=cn=Directory Manager connectionPassword=hadepyhkl connectionURL=ldap://vanja1234:389; digest=SHA roleBase=ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au roleName=cn roleSearch=(uniquemember={0}) roleSubtree=true userPassword=userPassword userPattern=uid={0},dc=abc,dc=com,dc=in / /Context Regards, Thangavel Sankaranarayanan David Smith [EMAIL PROTECTED] To Tomcat Users List 09/08/2008 10:44 users@tomcat.apache.org PM cc Subject Please respond to Re: Intermitant DB Problem in Tomcat Users tomcat:java.sql.SQLException: Io List exception: Connection reset by [EMAIL PROTECTED] peer: JVM_recv in socket input che.org stream read