• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in emplementing an efficient Queue Datastructure in servlet

 
laxmikant upadhyay
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to make a webapp which accepts HTTP Post Messages (inputStream) from request and Puts it into Queue and a worker thread will keep polling the elements from the queue and process it further one by one.
the Queue implementation is done to handle high load .



when i send the request i get following error at server end while accessing the inputstream.please help. or let me know some other way to implement the queue .

Going to parse inputStream
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl@1982fc1 org.apache.catalina.connector.CoyoteInputStream@14db0e3
org.apache.tomcat.jni.Error: APR does not understand this error code
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:261)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at Consumer.consume(Consumer.java:73)
at Consumer.run(Consumer.java:41)
at java.lang.Thread.run(Thread.java:619)
p.s->i am sure that it is not a problem of parser it is somthing related to i/p stream.
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are putting InputStreams into your queue???

That sounds kind of iffy to me. It seems to me that when the request has finished, then its input stream is going to be discarded. Having some other thread try to access that InputStream later doesn't sound right to me. So I'm not really surprised to find that it fails in a strange way.

 
laxmikant upadhyay
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:You are putting InputStreams into your queue???

That sounds kind of iffy to me. It seems to me that when the request has finished, then its input stream is going to be discarded. Having some other thread try to access that InputStream later doesn't sound right to me. So I'm not really surprised to find that it fails in a strange way.



hi Paul,thanks for your reply.
Now i am putting the Documnet object in the the queue after parsing the i/p stream.it is working fine till now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic