Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Client/Servlet Exceptions in WebLogic

23 views
Skip to first unread message

Brad Coomer

unread,
Feb 22, 2002, 3:36:00 PM2/22/02
to

We are running performance testing against our WebLogic system using a command
line Java program that spawns threads to simulate requests to the server.

The client program is throwing two different types of socket exceptions very sporadically,
usually 5 or so every 1000-3000 calls. The problem occurs on multiple WebLogic
servers. We narrowed the servlet to a bare minimum just to return what it receives.
When the client throws exceptions, the server also logs exceptions in the wl-domain.log
file. The exceptions happen at all load levels, but do not necessarily increase
with 100 threads versus 10 threads. Here are the exceptions we are getting on
the client side:

http://<snip>:7001/gateway
java.io.FileNotFoundException: http://<snip>:7001/gateway
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:574)
at XMLLoad$XMLLoadThread.run(xmlload.java:103)


Address in use: connect
java.net.BindException: Address in use: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.<init>(Socket.java:273)
at java.net.Socket.<init>(Socket.java:100)
at sun.net.NetworkClient.doConnect(NetworkClient.java:50)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:331)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:517)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:267)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:228)
at sun.net.www.protocol.http.HttpURLConnection.getNewClient(HttpURLConne
ction.java:272)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConn
ection.java:253)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:509)
at XMLLoad$XMLLoadThread.run(xmlload.java:103)


The client exceptions indicate a problem with getInputStream(). Here is a snipit
of code from the client thread which runs in a loop; and note I also tried moving
the dataOut.close() method after the dataOut.flush() method and got the same results:

//prepare http connection
URL url = new URL(urlRequest);
HttpURLConnection http = (HttpURLConnection) url.openConnection();
http.setDoInput(true);
http.setDoOutput(true);
http.setRequestMethod("POST");
http.setUseCaches(false);

//send data
DataOutputStream dataOut = new DataOutputStream(http.getOutputStream());
dataOut.writeBytes(xmlRequest);
dataOut.flush();

//receive data
String strTemp;
String xmlResponse = "";
InputStreamReader inputStreamReader = new InputStreamReader(http.getInputStream());
BufferedReader dataIn = new BufferedReader(inputStreamReader);
strTemp = dataIn.readLine();
while(strTemp != null) {
xmlResponse += strTemp;
strTemp = dataIn.readLine();
}//end while

//close http connection
dataOut.close();
dataIn.close();
http.disconnect();

//free memory
url = null;
http = null;
dataOut = null;
dataIn = null;
inputStreamReader = null;


And here is the WebLogic servlet doPost() code:

StringBuffer sbInputXML=null;
res.setContentType("text/xml; charset=utf-8");
PrintWriter out=res.getWriter();

//---------Get input XML post and convert it to a string
BufferedReader buf=req.getReader();
String strInputLine="";
sbInputXML=new StringBuffer();

while((strInputLine=buf.readLine())!= null){
sbInputXML.append(strInputLine);
}

out.println(sbInputXML.toString());
out.flush();
out.close();


And here are the WebLogic exceptions:


java.io.InterruptedIOException: Read timed out
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:86)
at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:124)
at weblogic.servlet.internal.ServletInputStreamImpl$1.read(ServletInputStreamImpl.java:60)
at weblogic.servlet.internal.ServletInputStreamImpl.read(ServletInputStreamImpl.java:97)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletRequestImpl.java:907)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(ServletRequestImpl.java:795)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:969)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(ServletRequestImpl.java:1905)
at weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.java:1713)
at weblogic.servlet.security.internal.ServletSecurityManager.checkAccess(ServletSecurityManager.java:107)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2432)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2039)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

java.net.ProtocolException: EOF after reading only: '0' of: '299' promised bytes,
out of which at least: '0' were already buffered
at weblogic.servlet.internal.PostInputStream.complain(PostInputStream.java:74)
at weblogic.servlet.internal.PostInputStream.read(PostInputStream.java:126)
at java.io.InputStream.skip(InputStream.java:219)
at java.io.FilterInputStream.skip(FilterInputStream.java:132)
at weblogic.servlet.internal.ServletInputStreamImpl.skip(ServletInputStreamImpl.java:108)
at weblogic.servlet.internal.ServletOutputStreamImpl.commit(ServletOutputStreamImpl.java:458)
at weblogic.servlet.internal.ServletOutputStreamImpl.finish(ServletOutputStreamImpl.java:483)
at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:985)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2044)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Assertion violated
]
at weblogic.utils.Debug.assert(Debug.java:74)
at weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletRequestImpl.java:910)
at weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(ServletRequestImpl.java:795)
at weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl.java:969)
at weblogic.servlet.internal.ServletRequestImpl.initSessionInfo(ServletRequestImpl.java:1905)
at weblogic.servlet.internal.ServletRequestImpl.getSession(ServletRequestImpl.java:1713)
at weblogic.servlet.internal.ServletRequestImpl.getRemoteUser(ServletRequestImpl.java:1039)
at weblogic.servlet.logging.CLFLogger.log(CLFLogger.java:60)
at weblogic.servlet.logging.LogManagerHttp.log(LogManagerHttp.java:292)
at weblogic.servlet.internal.HttpServer.log(HttpServer.java:791)
at weblogic.servlet.internal.ServletResponseImpl.send(ServletResponseImpl.java:998)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2044)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

Any ideas would be appreciated. And believe it or not, I think I nearly found
the end of the Internet searching for an answer......

Thanks,
Brad&#8230;

Bob Lee

unread,
Feb 22, 2002, 5:23:47 PM2/22/02
to
Based on the exceptions, the problem definately appears to be with the
client. It looks like the client is opening the connection but failing to
send any data on some occasions.

The only thing I can see is that you could move dataOut.close() immediately
after dataOut.flush(). Outside of that, I'd have to see the surrounding
code.

This article may be of some help:
http://www.javaworld.com/javaworld/jw-03-2001/jw-0323-traps.html.

Bob


"Brad Coomer" <brad....@verizon.com> wrote in message
news:3c76abb0$1...@newsgroups.bea.com...

Brad Coomer

unread,
Feb 25, 2002, 10:13:12 AM2/25/02
to

Bob,

Thanks for the reply and reference to the article. Putting the close() method
after the flush() method still produces the exceptions. Wrote a multithreaded
C++/MFC app and it did not produce any exceptions after 1.3 million calls...With
that it's most definately the client...

Thanks,
Brad...

>..java:97)


>> at
>weblogic.servlet.internal.ServletRequestImpl.mergePostParams(ServletRequestI
>mpl.java:907)
>> at
>weblogic.servlet.internal.ServletRequestImpl.parseQueryParams(ServletRequest
>Impl.java:795)
>> at
>weblogic.servlet.internal.ServletRequestImpl.getParameter(ServletRequestImpl

>..java:969)

>..java:108)

>..java:969)

0 new messages