Hello,

 

I am encountering IOException while getting input stream using
getInputStream() method on URLConnection class while sending data to
Tomcat. Error is pasted below.

 

"XML Regular I/O Exception - while getting the input stream from
http://12.34.56.78:80/myApp/servlet/com.myComp.xml.CollectorServlet |
original message -> 2006-03-04 22:20:05.54 java.io.IOException: Server
returned HTTP response code: 500 for URL:
http://12.34.56.78:80/myApp/servlet/com.myComp.xml.CollectorServlet";

 

The problem occurs after continuous operation of Tomcat server for about
one month. But server does not show any exception when client encounters
this problem. 

 

Please find the client code below.

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

URLConnection httpConnection = null;

 

//Code to open connection to URL

........

 

httpConnection.setDoOutput(true);

httpConnection.setDoInput(true);

httpConnection.setUseCaches(false);

httpConnection.setRequestProperty("Content-Type",
"text/xml;charset=UTF-8");

httpConnection.setRequestProperty("Authorization", authString);

 

//Code to get the output stream

........

 

outStream.write(......);

outStream.flush();

outStream.close();

 

try

{

inStream = httpConnection.getInputStream();

}

catch (IOException e)

{

String sMessage = "XML Regular I/O Exception - while getting the input
stream from " +

url.toString() + " | original message -> " + (e); 

throw new XMLExceptionIO(sMessage);

}

 

 

Thanks in advance.

Giridhar.

Reply via email to