java.net.SocketException: Connection reset by peer in setSocketOptions()

2013-08-03 Thread Kees Jan Koster
Dear All,

I have an exception that is littering my catalina.out. I see about 7000 of 
these on a normal day (server handles about 25 requests per second). It is this 
precise stack trace always. I have some other exceptions, but this one is the 
main headache I have today.

Tomcat 7.0.30
openjdk version 1.7.0_25
FreeBSD 9.1-STABLE

My questions:
1) What might be causing this?
2) What other information do you need to help shed some light on this problem?
3) How can I found out if this is happening from specific IP addresses maybe?
4) Any queues that might be overflowing? I have acceptCount 1024 and 
kern.ipc.somaxconn 1024, which should be plenty, right?
5) Any other steps I can take to dive deeper?

Aug 03, 2013 8:50:45 PM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE: 
java.net.SocketException: Connection reset by peer
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setSocketOption(Net.java:373)
at sun.nio.ch.SocketChannelImpl.setOption(SocketChannelImpl.java:189)
at sun.nio.ch.SocketAdaptor.setBooleanOption(SocketAdaptor.java:290)
at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:325)
at 
org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:199)
at 
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:649)
at 
org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:802)
at java.lang.Thread.run(Thread.java:724)

--
Kees Jan

http://java-monitor.com/
kjkos...@kjkoster.org
+31651838192

Repairing cannot be completed, you can only stop doing it.
-- Belarusian proverb

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Default configuration; Connection reset by peer

2012-07-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Phineas,

On 7/24/12 7:19 PM, Phineas Dole wrote:
 Test configuration: Connector port=8080
 protocol=org.apache.coyote.http11.Http11NioProtocol 
 acceptCount=10240 numThreads=1024

numThreads is not a recognized configuration attribute. Read the docs:
http://tomcat.apache.org/tomcat-7.0-doc/config/http.html

 I have increased somaxconn.

Are you sure?

 The error has become very consistent. I can trigger it by
 restarting tomcat and then running the test. Typically it takes 5s
 for ab to terminate. (Though ab states that several thousand
 requests have completed by that point, which appears true from the
 access logs).

With a trivial servlet, you should be able to handle a *lot* of load.
Are you testing on localhost (i.e. both ab and Tomcat run on the same
machine)?

 The high (10240) acceptCount seems to be the reason for the 
 consistent error. Decreasing it seems to make things more stable.

In general, I would expect that. There's not a really good reason for
a high acceptCount. If your machine can't handle a huge amount of
load, don't make a whole bunch of clients get in a huge line: just
refuse their connections.

 In fact, setting acceptCount=5 and connectionTimeout=-1 seems
 to delay the error by a huge amount, but it still occurs. Also,
 the connectionTimeout resolves length and exception errors 
 occasionally reported by ab. I presume this is related more to how 
 the client (ab) operates and not tomcat itself.

Perhaps. If it's appropriate for your testing, try using -k to
enable HTTP keepalive to see if you get better throughput (and fewer
errors).

 The acceptCount is counter-intuitive to me. Was this the intended 
 solution you had in mind.

No: I think you should change maxThreads. Better yet, use an
Executor so you have better control over everything. TC7 always uses
an Executor implicitly, but there are fewer configuration options
when doing it through the Connector.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAQEn4ACgkQ9CaO5/Lv0PA1RACgpOoW6lPrO4vEDA8/kMnKFtKk
7QoAnA7G7uz2wD2YmoLmuHUKA3sp4W3l
=RCwk
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Default configuration; Connection reset by peer

2012-07-24 Thread Phineas Dole
I am currently benchmarking tomcat to see what sort of performance I can expect.

I setup tomcat with the default configuration and then run ab -c 1000 -n 
100 http://localhost:8080/examples/servlets/servlet/HelloWorldExample;

Occasionally, ab will terminate prematurely with error such as 
apr_socket_recv: Connection reset by peer (104)

This happens with bio, nio, and apr connectors.

How do I configure tomcat or my OS to handle this workload? I have not 
experienced this problem with other webservers or Jetty... what is happening?

Versions:
Tomcat 7.0.29
ab 2.3

Re: Default configuration; Connection reset by peer

2012-07-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Phineas,

On 7/24/12 4:59 PM, Phineas Dole wrote:
 I am currently benchmarking tomcat to see what sort of performance
 I can expect.
 
 I setup tomcat with the default configuration and then run ab -c 
 1000 -n 100 
 http://localhost:8080/examples/servlets/servlet/HelloWorldExample;

Note that the default configuration of Tomcat's Connector has
maxThreads=200 and acceptCount=100 meaning that Tomcat will only
actively process 200 simultaneous connections and the OS is expected to
accept 100 connections and queue them until Tomcat is ready to actively
handle them.

I suspect you will very quickly fill-up the accept queue and start
getting connections dropped, unless your test servlet runs very quickly.

 Occasionally, ab will terminate prematurely with error such as 
 apr_socket_recv: Connection reset by peer (104)
 
 This happens with bio, nio, and apr connectors.
 
 How do I configure tomcat or my OS to handle this workload? I have 
 not experienced this problem with other webservers or Jetty...
 what is happening?

What was their configuration in terms of request processors, etc.?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAPFNYACgkQ9CaO5/Lv0PC0LACgrUikOLHu3LBmwZap9ZzwG0Ap
B6IAnA+ze3YX2a4elffzB3cHsxLmwKgY
=UKxo
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Default configuration; Connection reset by peer

2012-07-24 Thread Phineas Dole
Test configuration:
Connector port=8080 protocol=org.apache.coyote.http11.Http11NioProtocol
               acceptCount=10240
               numThreads=1024
               connectionTimeout=2
               redirectPort=8443 /

I have increased somaxconn.

The error has become very consistent. I can trigger it by restarting tomcat and 
then running the test. Typically it takes 5s for ab to terminate. (Though ab 
states that several thousand requests have completed by that point, which 
appears true from the access logs).

The high (10240) acceptCount seems to be the reason for the consistent error. 
Decreasing it seems to make things more stable. In fact, setting 
acceptCount=5 and connectionTimeout=-1 seems to delay the error by a huge 
amount, but it still occurs. Also, the connectionTimeout resolves length and 
exception errors occasionally reported by ab. I presume this is related more 
to how the client (ab) operates and not tomcat itself.

The acceptCount is counter-intuitive to me. Was this the intended solution you 
had in mind.

Thanks for the insight!



 From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org 
Sent: Tuesday, July 24, 2012 2:34 PM
Subject: Re: Default configuration; Connection reset by peer
 
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Phineas,

On 7/24/12 4:59 PM, Phineas Dole wrote:
 I am currently benchmarking tomcat to see what sort of performance
 I can expect.
 
 I setup tomcat with the default configuration and then run ab -c 
 1000 -n 100 
 http://localhost:8080/examples/servlets/servlet/HelloWorldExample;

Note that the default configuration of Tomcat's Connector has
maxThreads=200 and acceptCount=100 meaning that Tomcat will only
actively process 200 simultaneous connections and the OS is expected to
accept 100 connections and queue them until Tomcat is ready to actively
handle them.

I suspect you will very quickly fill-up the accept queue and start
getting connections dropped, unless your test servlet runs very quickly.

 Occasionally, ab will terminate prematurely with error such as 
 apr_socket_recv: Connection reset by peer (104)
 
 This happens with bio, nio, and apr connectors.
 
 How do I configure tomcat or my OS to handle this workload? I have 
 not experienced this problem with other webservers or Jetty...
 what is happening?

What was their configuration in terms of request processors, etc.?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAPFNYACgkQ9CaO5/Lv0PC0LACgrUikOLHu3LBmwZap9ZzwG0Ap
B6IAnA+ze3YX2a4elffzB3cHsxLmwKgY
=UKxo
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Connection reset by peer in org.apache.tomcat.util.net.NioEndpoint setSocketOptions

2012-06-10 Thread Kees Jan Koster
Dear All,

I get these errors in the logs quite frequently. About 1500 times every day. 
The application works nicely, strangely enough.

What is happening here? How can I resolve these error messages?

Should I worry?

Jun 10, 2012 4:43:17 PM org.apache.tomcat.util.net.NioEndpoint setSocketOptions
SEVERE: 
java.net.SocketException: Connection reset by peer
at sun.nio.ch.Net.setIntOption0(Native Method)
at sun.nio.ch.Net.setIntOption(Net.java:154)
at sun.nio.ch.SocketChannelImpl$1.setInt(SocketChannelImpl.java:406)
at sun.nio.ch.SocketOptsImpl.setBoolean(SocketOptsImpl.java:38)
at sun.nio.ch.SocketOptsImpl$IP$TCP.noDelay(SocketOptsImpl.java:284)
at sun.nio.ch.OptionAdaptor.setTcpNoDelay(OptionAdaptor.java:48)
at sun.nio.ch.SocketAdaptor.setTcpNoDelay(SocketAdaptor.java:268)
at 
org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:183)
at 
org.apache.tomcat.util.net.NioEndpoint.setSocketOptions(NioEndpoint.java:1090)
at 
org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:1317)
at java.lang.Thread.run(Thread.java:619)

Tomcat 6.0.26 on FreeBSD 9.0-STABLE.
# /usr/local/jdk1.6.0/bin/java -version
java version 1.6.0_03-p4
Java(TM) SE Runtime Environment (build 
1.6.0_03-p4-kjkoster_30_nov_2011_10_57-b00)
Java HotSpot(TM) 64-Bit Server VM (build 
1.6.0_03-p4-kjkoster_30_nov_2011_10_57-b00, mixed mode)
# _
--
Kees Jan

http://java-monitor.com/
kjkos...@kjkoster.org
+31651838192

Human beings make life so interesting. Do you know that in a universe so full 
of wonders,
they have managed to invent boredom. Quite astonishing... -- Terry Pratchett


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Who ate my Connection reset by peer SocketException?

2011-08-04 Thread Debashis Roy

Hi,
 
Trying something which involves catching the Connection reset by peer 
SocketException. Below is the code snippet from my servlet with explanatory 
comments.
Does anyone have any idea as to what is happening?
 
try
{
 byte [] bytes = getContentBytes(); //read the actual bytes of the content into 
an array.
 resp.addHeader(Content-Disposition, attachment;filename=somefile.zip);
 resp.addHeader(Content-Type, application/zip);
 resp.addHeader(Pragma, no-cache);
 resp.addHeader(Connection, close);
 resp.setContentLength(bytes.length);
 OutputStream os = resp.getOutputStream();
 for (int i = 0; i  bytes.length; i++)
 {
  System.out.println(writing byte  + i);
  os.write(bytes[i]);
  /* write all bytes but the last one to the ostream */
  /* the file save dialog shows up in the browser */
  /* netstat shows an established connection from browser to 8080 of tomcat 
host */
  if (i == bytes.length - 2)
  {
   System.out.println(doing intermediate flush...);
   resp.flushBuffer();
   /* sleep for 30 secs */
   /* during this time close the browser and click cancel on the file save 
dialog*/
   /* netstat shows zero connections with port 8080 of tomcat */
   try
   {
Thread.sleep(3);
   }
   catch (InterruptedException interex)
   {
   }
  }
  /* the last byte gets written after the sleep period */
  /* was expecting to see the connection reset by peer exception here */
 }
 /* or here */
 resp.flushBuffer();
 
 /* Voila !!! no exceptions till here and the code exits cleanly !!! */
}
catch (Throwable th)
{
 th.printStackTrace();
}
  

Re: Who ate my Connection reset by peer SocketException?

2011-08-04 Thread André Warnier

Debashis Roy wrote:

Hi,
 
Trying something which involves catching the Connection reset by peer SocketException. Below is the code snippet from my servlet with explanatory comments.

Does anyone have any idea as to what is happening?
 
try

{
 byte [] bytes = getContentBytes(); //read the actual bytes of the content into 
an array.
 resp.addHeader(Content-Disposition, attachment;filename=somefile.zip);
 resp.addHeader(Content-Type, application/zip);
 resp.addHeader(Pragma, no-cache);
 resp.addHeader(Connection, close);
 resp.setContentLength(bytes.length);
 OutputStream os = resp.getOutputStream();
 for (int i = 0; i  bytes.length; i++)
 {
  System.out.println(writing byte  + i);
  os.write(bytes[i]);
  /* write all bytes but the last one to the ostream */
  /* the file save dialog shows up in the browser */
  /* netstat shows an established connection from browser to 8080 of tomcat 
host */
  if (i == bytes.length - 2)
  {
   System.out.println(doing intermediate flush...);
   resp.flushBuffer();
   /* sleep for 30 secs */
   /* during this time close the browser and click cancel on the file save 
dialog*/
   /* netstat shows zero connections with port 8080 of tomcat */
   try
   {
Thread.sleep(3);
   }
   catch (InterruptedException interex)
   {
   }
  }
  /* the last byte gets written after the sleep period */
  /* was expecting to see the connection reset by peer exception here */
 }
 /* or here */
 resp.flushBuffer();
 
 /* Voila !!! no exceptions till here and the code exits cleanly !!! */

}
catch (Throwable th)
{
 th.printStackTrace();
}
 		 	   		  


Is there anything at all between the browser and Tomcat ?
(thinking of a front-end webserver/load balancer etc..)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Who ate my Connection reset by peer SocketException?

2011-08-04 Thread Debashis Roy

Nothing in between browser and tomcat... direct connection from IE to 8080.
 

 Date: Thu, 4 Aug 2011 18:19:58 +0200
 From: a...@ice-sa.com
 To: users@tomcat.apache.org
 Subject: Re: Who ate my Connection reset by peer SocketException?
 
 Debashis Roy wrote:
  Hi,
  
  Trying something which involves catching the Connection reset by peer 
  SocketException. Below is the code snippet from my servlet with explanatory 
  comments.
  Does anyone have any idea as to what is happening?
  
  try
  {
  byte [] bytes = getContentBytes(); //read the actual bytes of the content 
  into an array.
  resp.addHeader(Content-Disposition, attachment;filename=somefile.zip);
  resp.addHeader(Content-Type, application/zip);
  resp.addHeader(Pragma, no-cache);
  resp.addHeader(Connection, close);
  resp.setContentLength(bytes.length);
  OutputStream os = resp.getOutputStream();
  for (int i = 0; i  bytes.length; i++)
  {
  System.out.println(writing byte  + i);
  os.write(bytes[i]);
  /* write all bytes but the last one to the ostream */
  /* the file save dialog shows up in the browser */
  /* netstat shows an established connection from browser to 8080 of tomcat 
  host */
  if (i == bytes.length - 2)
  {
  System.out.println(doing intermediate flush...);
  resp.flushBuffer();
  /* sleep for 30 secs */
  /* during this time close the browser and click cancel on the file save 
  dialog*/
  /* netstat shows zero connections with port 8080 of tomcat */
  try
  {
  Thread.sleep(3);
  }
  catch (InterruptedException interex)
  {
  }
  }
  /* the last byte gets written after the sleep period */
  /* was expecting to see the connection reset by peer exception here */
  }
  /* or here */
  resp.flushBuffer();
  
  /* Voila !!! no exceptions till here and the code exits cleanly !!! */
  }
  catch (Throwable th)
  {
  th.printStackTrace();
  }
  
 
 Is there anything at all between the browser and Tomcat ?
 (thinking of a front-end webserver/load balancer etc..)
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  

Re: Who ate my Connection reset by peer SocketException?

2011-08-04 Thread David kerber

On 8/4/2011 1:38 PM, Debashis Roy wrote:


Nothing in between browser and tomcat... direct connection from IE to 8080.


Not even a router?  What about the windows firewall?






Date: Thu, 4 Aug 2011 18:19:58 +0200
From: a...@ice-sa.com
To: users@tomcat.apache.org
Subject: Re: Who ate my Connection reset by peer SocketException?

Debashis Roy wrote:

Hi,

Trying something which involves catching the Connection reset by peer 
SocketException. Below is the code snippet from my servlet with explanatory comments.
Does anyone have any idea as to what is happening?

try
{
byte [] bytes = getContentBytes(); //read the actual bytes of the content into 
an array.
resp.addHeader(Content-Disposition, attachment;filename=somefile.zip);
resp.addHeader(Content-Type, application/zip);
resp.addHeader(Pragma, no-cache);
resp.addHeader(Connection, close);
resp.setContentLength(bytes.length);
OutputStream os = resp.getOutputStream();
for (int i = 0; i  bytes.length; i++)
{
System.out.println(writing byte  + i);
os.write(bytes[i]);
/* write all bytes but the last one to the ostream */
/* the file save dialog shows up in the browser */
/* netstat shows an established connection from browser to 8080 of tomcat host 
*/
if (i == bytes.length - 2)
{
System.out.println(doing intermediate flush...);
resp.flushBuffer();
/* sleep for 30 secs */
/* during this time close the browser and click cancel on the file save dialog*/
/* netstat shows zero connections with port 8080 of tomcat */
try
{
Thread.sleep(3);
}
catch (InterruptedException interex)
{
}
}
/* the last byte gets written after the sleep period */
/* was expecting to see the connection reset by peer exception here */
}
/* or here */
resp.flushBuffer();

/* Voila !!! no exceptions till here and the code exits cleanly !!! */
}
catch (Throwable th)
{
th.printStackTrace();
}



Is there anything at all between the browser and Tomcat ?
(thinking of a front-end webserver/load balancer etc..)



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Who ate my Connection reset by peer SocketException?

2011-08-04 Thread Debashis Roy

Thanks for the lead guys. Looks like something is there could be the windows 
firewall.
Both tomcat and browser are on the same machine. Tried accessing the service 
using localhost, got the exception.
Tried using IP address, no exception :(.
Any trick using which I can get this exception reliably? I am already using the 
header Pragma: no-cache.

 

 Date: Thu, 4 Aug 2011 14:01:16 -0400
 From: dcker...@verizon.net
 To: users@tomcat.apache.org
 Subject: Re: Who ate my Connection reset by peer SocketException?
 
 On 8/4/2011 1:38 PM, Debashis Roy wrote:
 
  Nothing in between browser and tomcat... direct connection from IE to 8080.
 
 Not even a router? What about the windows firewall?
 
 
 
 
  Date: Thu, 4 Aug 2011 18:19:58 +0200
  From: a...@ice-sa.com
  To: users@tomcat.apache.org
  Subject: Re: Who ate my Connection reset by peer SocketException?
 
  Debashis Roy wrote:
  Hi,
 
  Trying something which involves catching the Connection reset by peer 
  SocketException. Below is the code snippet from my servlet with 
  explanatory comments.
  Does anyone have any idea as to what is happening?
 
  try
  {
  byte [] bytes = getContentBytes(); //read the actual bytes of the content 
  into an array.
  resp.addHeader(Content-Disposition, attachment;filename=somefile.zip);
  resp.addHeader(Content-Type, application/zip);
  resp.addHeader(Pragma, no-cache);
  resp.addHeader(Connection, close);
  resp.setContentLength(bytes.length);
  OutputStream os = resp.getOutputStream();
  for (int i = 0; i bytes.length; i++)
  {
  System.out.println(writing byte  + i);
  os.write(bytes[i]);
  /* write all bytes but the last one to the ostream */
  /* the file save dialog shows up in the browser */
  /* netstat shows an established connection from browser to 8080 of tomcat 
  host */
  if (i == bytes.length - 2)
  {
  System.out.println(doing intermediate flush...);
  resp.flushBuffer();
  /* sleep for 30 secs */
  /* during this time close the browser and click cancel on the file save 
  dialog*/
  /* netstat shows zero connections with port 8080 of tomcat */
  try
  {
  Thread.sleep(3);
  }
  catch (InterruptedException interex)
  {
  }
  }
  /* the last byte gets written after the sleep period */
  /* was expecting to see the connection reset by peer exception here */
  }
  /* or here */
  resp.flushBuffer();
 
  /* Voila !!! no exceptions till here and the code exits cleanly !!! */
  }
  catch (Throwable th)
  {
  th.printStackTrace();
  }
 
 
  Is there anything at all between the browser and Tomcat ?
  (thinking of a front-end webserver/load balancer etc..)
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
  
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  

Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read

2008-09-08 Thread Johnny Kewl


- 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

2008-09-08 Thread Thangavel Sankaranarayanan
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]



Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read

2008-09-08 Thread Thangavel Sankaranarayanan

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

2008-09-08 Thread David Smith

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

2008-09-08 Thread Thangavel Sankaranarayanan
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 commands

Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read

2008-09-08 Thread David Smith
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

2008-09-08 Thread Thangavel Sankaranarayanan
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

2008-09-08 Thread David Smith
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

2008-09-08 Thread Thangavel Sankaranarayanan
 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]




-
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

2008-09-08 Thread David Smith
 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

2008-09-08 Thread 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);
   }
   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

2008-09-08 Thread Thangavel Sankaranarayanan
://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
 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

RE: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read

2008-09-08 Thread Martin Gainty

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 PROTECTED

Re: Intermitant DB Problem in tomcat:java.sql.SQLException: Io exception: Connection reset by peer: JVM_recv in socket input stream read

2008-09-08 Thread David Smith
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

java.net.socketException...Connection reset by peer: JVM_recv in socket input stream read!!

2008-08-25 Thread Thangavel Sankaranarayanan

Hi ,

I am getting a java.net.socket exception in tomcat
Stack trace is below...
  To avoid this errror what can be done.?


java.net.SocketException: Connection reset by peer: JVM_recv in socket
input stream read
  at java.net.SocketInputStream.socketRead0(Native Method)
  at java.net.SocketInputStream.read(SocketInputStream.java:116)
  at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
  at
org.apache.commons.httpclient.HttpConnection.isStale(HttpConnection.java:506)
  at
org.apache.commons.httpclient.HttpConnection.closeIfStale(HttpConnection.java:431)
  at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.closeIfStale(MultiThreadedHttpConnectionManager.java:1291)
  at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:354)
  at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
  at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:393)
  at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
  at
au.com.vodafone.siebel.transport.http.HttpSwsTransport.send(HttpSwsTransport.java:62)
  at
au.com.vodafone.siebel.message.SwsRequestMsg.send(SwsRequestMsg.java:47)
  at
au.com.vodafone.mpp.siebel.SiebelFactory.isValidBan(SiebelFactory.java:670)
  at
au.com.vodafone.mpp.ui.action.VerifyCustomerAction.execute(VerifyCustomerAction.java:247)
  at au.com.vodafone.mpp.ui.action.MPPAction.execute(MPPAction.java:97)
  at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
  at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
  at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
  at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
  at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422)
  at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:163)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at
au.com.objectconsulting.catalina.valves.SetRemoteUserValve.invoke(SetRemoteUserValve.java:27)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
  at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
  at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
  at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
  at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199)
  at
org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:324)
  at
org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:395

connection reset by peer

2007-08-09 Thread Yair Zohar

Hello,
I'm using tomcat5.5.23 on a Fedora 5 kernel: 2.6.20-1.2320.fc5.
I redirect port 80 to 8080 by running by root:

iptables -t nat -A OUTPUT -d localhost -p tcp --dport 80 -j REDIRECT 
--to-ports 8080
iptables -t nat -A PREROUTING -p tcp --dport 80 -i eth0 -j REDIRECT 
--to-port 8080


Sometimes (quite often) I get connection reset by peer, in the middle of 
page loading.


It looks like that when running wget (although it happens also using 
firefox and ie):


Connecting to ard.huji.ac.il|132.64.50.50|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]

0% [ ] 2,555 --.--K/s

23:43:29 (169.02 KB/s) - Read error at byte 271959 (Connection reset by 
peer).Retrying.


it happens each time in a different stage of the page download.
It happens mainly (or only) on large pages (~45 bytes).

the server is inside inside a firewall, the error occurs when trying to 
access it from outside the firewall,

I couldn't reproduce the error from inside the firewall.

Can someone help with that ?
Yair.

-
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: Suppress Connection reset by peer: socket write error.

2005-10-14 Thread Dola Woolfe
Hi Robert,

What a truly fantastic answer! Very detailed and
educational. Your timeis deeply appreciated.

What I'd like to know is: do I have to do it in every
JSP (I have hundreds). And is there a configuration
solution as was alluded by Bill previously?

Once again, very many thanks!!!

Dola

--- Robert Graf-Waczenski [EMAIL PROTECTED] wrote:

 Hi!
 
 First, some background:
 
 The exception your app actually gets internally is a
 SocketException with the text you mention below.
 It occurs if the client browser prematurely cancels
 an http request before tomcat has completed sending
 the full response data to the client.
 Another manifestation may be a SocketException with
 the text Socket closed, which *may* occur if your
 app serves big download data streams and the client
 cancels the download.
 
 The bottom line is that these two exceptions simply
 happen in real life web apps and that they can be
 safely ignored.
 
 However, you correctly want to know how your app can
 perform the magic to safely ignore these two
 exceptions outomatically, right?
 
 So you will need to add some error handling that
 would
 basically consist of wrapping everyting in your app
 inside a try/catch block that would swallow the
 two variants of SocketException above. But the
 problem
 with this approach is that you must not simply
 swallow
 *all* SocketExceptions.
 
 Here's what we do in our app:
 
 catch(SocketException e) {
   String stackTrace  = Util.getStackTrace(e); //
 this extracts the full
 stack trace
   if ((stackTrace.indexOf(socket write error)  -1
|| stackTrace.indexOf(Socket closed)  -1)
  
 

(stackTrace.indexOf(org.apache.tomcat.service.http.HttpResponseAdapter
 )  -1
||

stackTrace.indexOf(javax.servlet.http.HttpServlet.service()
  -1))
   {
   log(Client signalled end of socket
 communication);
   }
   else
 throw e;
 }
 
 (Note that you may have to re-construct the full
 lines
 of the source code above as my mail client may have
 introduced linebreaks at bad places...)
 
 Yes, we log an error message even if this particular
 client
 aborted request situation was detected. You may
 want to swallow
 this silently, but i would suggest to not do this
 because you
 (and we) never are sure if the stack trace analysis
 above is
 perfect. The other down side of this approach is
 that future
 versions of Java and/or Tomcat may change the
 exception message
 texts and/or the structure of the stack trace. But
 currently
 (JDK 1.5 / Tomcat 5.5) this approach does what was
 intended.
 
 Robert
 
  -Original Message-
  From: Dola Woolfe [mailto:[EMAIL PROTECTED]
  Sent: Friday, October 14, 2005 3:17 AM
  To: Tomcat Users List
  Subject: Re: Suppress Connection reset by peer:
 socket write error.
 
 
  Hi Bill,
 
  Thanks for your answer and sorry for the delay in
 my
  reply!
 
  I'm using standalong Tomcat 5.5 listening on port
 80.
  I'm using jdk 1.5 on WinXP. I'm not using any
 special
  logging. I'm running Tomcat in a console, simply
 by
  typing startup in tomcat/bin.
 
  What I don't want happening is for the Connection
  reset by peer: socket write error to be displayed
 in
  the console window.
 
  Given this detailed information, would you mind
  refining your recommendation?
 
  Thank you very much in advance,
 
  Dola Chin
 
 
 
  --- Bill Barker [EMAIL PROTECTED] wrote:
 
  
   Dola Woolfe [EMAIL PROTECTED] wrote in
 message
  
 

news:[EMAIL PROTECTED]
Hi,
   
I apologize for asking this question again for
 I
remembering asking this question in the past,
 but
   I
can't find the response.
   
What setting (and where) will suppress the
aforementioned exception in the tomcat log?
   
  
   Including the Tomcat version helps ;-).
  
   I'm assuming that this is for the AJP/1.3
 Connector.
The answer is to
   change the logging level for that component to
 be
   one higher than the level
   in the message (in the latest version, it's at
 DEBUG
   level and I don't
   remember what it used to be).  For example, if
 you
   are using JDK1.4 logging
   you would do something like:
 org.apache.jk.common.level=SEVERE
  
   in your logging.properties file.
  
Thank you very much in advance, again!
   
Dola
   
   
   
__
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
  
  
  
  
  
 

-
   To unsubscribe, e-mail:
   [EMAIL PROTECTED]
   For additional commands, e-mail:
   [EMAIL PROTECTED]
  
  
 
 
 
 
  __
  Yahoo! Music Unlimited
  Access over 1 million songs. Try it free.
  http://music.yahoo.com/unlimited/
 
 

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

-
 To unsubscribe

RE: Suppress Connection reset by peer: socket write error.

2005-10-14 Thread Robert Graf-Waczenski
Hi Dola,

right off of my head, i can't come up with a smart configuration
solution that would selectively swallow the message as our approach
does. Our app has two shared JSPs that are included in every JSP, one at
the top and one at the bottom. The top-included JSP opens the try block
(making it illegal for many IDEs such as IntelliJ or similar), the
bottom-included JSP contains the catch block with the handling code.
(Actually, our approach differs slightly from what i described to you:
Our top/bottom JSPs take care of logging everything to a central logger
class and the logger class, in turn, inspects the stack trace and avoids
to perform a critical logging if the stack trace looks as i described
it.)

But, yes, if your hundreds of JSPs do not have two such globally shared
include JSPs, then you are in some trouble and have to introduce the two
include statements, one at the top and the other at the bottom. (You may
want to use smart shell scripting for this...) Then, add your two
top/bottom JSPs and you are done with your JSPs.

And don't forget your servlet classes: If any of your web requests are
served by a servlet, you have to add the try/catch block to the servlet
class, too.

Robert

 -Original Message-
 From: Dola Woolfe [mailto:[EMAIL PROTECTED]
 Sent: Friday, October 14, 2005 8:43 AM
 To: Tomcat Users List
 Subject: RE: Suppress Connection reset by peer: socket write error.


 Hi Robert,

 What a truly fantastic answer! Very detailed and
 educational. Your timeis deeply appreciated.

 What I'd like to know is: do I have to do it in every
 JSP (I have hundreds). And is there a configuration
 solution as was alluded by Bill previously?

 Once again, very many thanks!!!

 Dola

 --- Robert Graf-Waczenski [EMAIL PROTECTED] wrote:

  Hi!
 
  First, some background:
 
  The exception your app actually gets internally is a
  SocketException with the text you mention below.
  It occurs if the client browser prematurely cancels
  an http request before tomcat has completed sending
  the full response data to the client.
  Another manifestation may be a SocketException with
  the text Socket closed, which *may* occur if your
  app serves big download data streams and the client
  cancels the download.
 
  The bottom line is that these two exceptions simply
  happen in real life web apps and that they can be
  safely ignored.
 
  However, you correctly want to know how your app can
  perform the magic to safely ignore these two
  exceptions outomatically, right?
 
  So you will need to add some error handling that
  would
  basically consist of wrapping everyting in your app
  inside a try/catch block that would swallow the
  two variants of SocketException above. But the
  problem
  with this approach is that you must not simply
  swallow
  *all* SocketExceptions.
 
  Here's what we do in our app:
 
  catch(SocketException e) {
String stackTrace  = Util.getStackTrace(e); //
  this extracts the full
  stack trace
if ((stackTrace.indexOf(socket write error)  -1
 || stackTrace.indexOf(Socket closed)  -1)
   
 
 
 (stackTrace.indexOf(org.apache.tomcat.service.http.HttpRespon
 seAdapter
  )  -1
 ||
 
 stackTrace.indexOf(javax.servlet.http.HttpServlet.service()
   -1))
{
  log(Client signalled end of socket
  communication);
}
else
  throw e;
  }
 
  (Note that you may have to re-construct the full
  lines
  of the source code above as my mail client may have
  introduced linebreaks at bad places...)
 
  Yes, we log an error message even if this particular
  client
  aborted request situation was detected. You may
  want to swallow
  this silently, but i would suggest to not do this
  because you
  (and we) never are sure if the stack trace analysis
  above is
  perfect. The other down side of this approach is
  that future
  versions of Java and/or Tomcat may change the
  exception message
  texts and/or the structure of the stack trace. But
  currently
  (JDK 1.5 / Tomcat 5.5) this approach does what was
  intended.
 
  Robert
 
   -Original Message-
   From: Dola Woolfe [mailto:[EMAIL PROTECTED]
   Sent: Friday, October 14, 2005 3:17 AM
   To: Tomcat Users List
   Subject: Re: Suppress Connection reset by peer:
  socket write error.
  
  
   Hi Bill,
  
   Thanks for your answer and sorry for the delay in
  my
   reply!
  
   I'm using standalong Tomcat 5.5 listening on port
  80.
   I'm using jdk 1.5 on WinXP. I'm not using any
  special
   logging. I'm running Tomcat in a console, simply
  by
   typing startup in tomcat/bin.
  
   What I don't want happening is for the Connection
   reset by peer: socket write error to be displayed
  in
   the console window.
  
   Given this detailed information, would you mind
   refining your recommendation?
  
   Thank you very much in advance,
  
   Dola Chin
  
  
  
   --- Bill Barker [EMAIL PROTECTED] wrote:
  
   
Dola Woolfe [EMAIL PROTECTED] wrote in
  message
   
  
 
 news:[EMAIL PROTECTED