I have a problem that causes all threads in JBOSS to block while reading an input stream. This does not happen predictably, and the system can work for several days (or longer) before it begins to suffer.
The problem is similar to this question, but I still have to try to establish -Dhttp.keepAlive=false, as recommended in the answer, because I was wondering if anyone has any other / better solution. I would prefer not to expose myself to a performance hit by setting this property to false (assuming it even fixes the problem).
There are some Sun errors that indicate reading problems BufferedReaderand InputStream( error 6192696 , error 6409506 ), but to me they seem a little unconvincing. Your thoughts / advice / experience with such a problem and Sun errors will be welcome.
Here is the Exception:
java.io.IOException
at org.apache.jk.common.JkInputStream.receive(JkInputStream.java:190)
at org.apache.jk.common.JkInputStream.refillReadBuffer(JkInputStream.java:249)
at org.apache.jk.common.JkInputStream.doRead(JkInputStream.java:168)
at org.apache.coyote.Request.doRead(Request.java:418)
at org.apache.catalina.connector.InputBuffer.realReadBytes(InputBuffer.java:284)
at org.apache.tomcat.util.buf.ByteChunk.substract(ByteChunk.java:404)
at org.apache.catalina.connector.InputBuffer.read(InputBuffer.java:299)
at org.apache.catalina.connector.CoyoteInputStream.read(CoyoteInputStream.java:192)
at com.vicinity.ExtractMessageServlet.service(ExtractMessageServlet.java:62)
...
Here is an example of request headers:
POST http: //www.xyz.com HTTP/1.0
Host: www.xyz.com:80
Accept: */*
Content-Type: application/octet-stream
Content-Length: 00597
Session-Key: 812a0000
Here is the Servletweb application code . He was stuck on servletInputStream.read:
int lengthOfBuffer = request.getContentLength();
byte[] buffer = new byte[lengthOfBuffer];
ByteArrayOutputStream output = new ByteArrayOutputStream(lengthOfBuffer);
ServletInputStream servletInputStream = request.getInputStream();
int readBytes = -1;
while ((readBytes = servletInputStream.read(buffer, 0, lengthOfBuffer)) != -1) {
output.write(buffer, 0, readBytes);
}
byte[] inputStream = output.toByteArray();
...
JBoss Version: JBoss AS 4.0.5.GA.
It also mod_jkroutes HTTP requests to port 80 from the Apache server to the JBoss server - if that's interesting.
source
share