This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes error in emplementing an efficient Queue Datastructure in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "error in emplementing an efficient Queue Datastructure in servlet" Watch "error in emplementing an efficient Queue Datastructure in servlet" New topic
Author

error in emplementing an efficient Queue Datastructure in servlet

laxmikant upadhyay
Greenhorn

Joined: Aug 24, 2012
Posts: 14
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
Bartender

Joined: Oct 14, 2005
Posts: 18709
    
    8

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

Joined: Aug 24, 2012
Posts: 14
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in emplementing an efficient Queue Datastructure in servlet