I wrote a servlet that parses the input stream of a request in the doPost()
method using xerces.  If I parse the input stream and then try to use jdbc,
the following line stalls:

Connection con = DriverManager.getConnection();

After about 5 seconds of waiting for that line to execute, I get the
following exception:

Read timed out
com.evermind.server.http.HttpIOException: Read timed out
        at com.evermind.server.http.e1.read(JAX)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at
org.apache.xerces.utils.ChunkyByteArray.fill(ChunkyByteArray.java:209)
        at
org.apache.xerces.utils.ChunkyByteArray.<init>(ChunkyByteArray.java:98)
        at
org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFac
tory.java:153)
        at
org.apache.xerces.framework.XMLParser.startReadingFromDocument(XMLParser.jav
a:2403)
        at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:346)
        at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1207)
        at com.crysalis.messaging.mxml.MxmlParser.parse(MxmlParser.java:161)
        at
com.crysalis.messaging.server.MxmlRouter.doPost(MxmlRouter.java:89)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:204)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:302)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)
        at com.evermind.server.http.d3.sw(JAX)
        at com.evermind.server.http.d3.su(JAX)
        at com.evermind.server.http.ef.s1(JAX)
        at com.evermind.server.http.ef.do(JAX)
        at com.evermind.util.f.run(JAX)

If I remove the code that parses the input stream, everything works
correctly.  Here is a sample of my current code:

 BufferedInputStream bis = new
BufferedInputStream(request.getInputStream());
 MxmlParser parser = new MxmlParser();
 inMsg = parser.parse(bis);    // this method uses xerces SAX parser
 bis.close();
  ...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// line below never finishes executing
Connection con = DriverManager.getConnection(jdbcURL);

I must point out that it is not the length of time it takes to parse the xml
that is causing the timeout.  In the code, the xml is fully parsed before
the jdbc call is made, and the jdbc call alone takes stalls for over 5
seconds before the exception is thrown!  When I remove the code that parses
the xml, the jdbc call is completed in less than 0.5 seconds.

Anyone know whats going on?  Anyone seen anything like this before?



Mike Christoff



Reply via email to