Hi Peter, SAX parsers are not allowed to be re-entrant. Servlets are re-entrant by default unless they implement SingleThreadModel. Try adding a synchronized block around the parser.parse(new XSLTInputSource(is)); call.
Best, Scott Stirling > -----Original Message----- > From: png [mailto:[EMAIL PROTECTED] > Sent: Monday, May 06, 2002 6:27 PM > To: '[EMAIL PROTECTED]' > Subject: Help with ConcurrentModificationException! > > > Hey all, > > Please let me know if this is not an appropriate topic for > this mailing list. I apologize if it isn't. > > I get this exception when i'm using the Xerces SAXParser. > I'm using Apache/Resin running Java 1.3.1/Xerces 1.4.4 The > exception is: java.util.ConcurrentModificationException > at > org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1111) > at > com.kargo.comfy.translator.Translator.process(Translator.java:155) > at > com.kargo.comfy.translator.TranslatorServlet.service(Translato > rServlet.java: > 181) > at javax.servlet.http.HttpServlet.service(HttpServlet.java:83) > at > com.caucho.server.http.QNamedDispatcher.service(QNamedDispatch > er.java:153) > at > com.caucho.server.http.QNamedDispatcher.chain(QNamedDispatcher > .java:100) > at > com.caucho.server.http.AbstractRequest.service(AbstractRequest > .java:472) > at > com.caucho.server.http.AbstractRequest.service(AbstractRequest > .java:395) > at > com.caucho.server.http.PageCache$Entry.service(PageCache.java:256) > at > com.caucho.server.http.PageCache.service(PageCache.java:105) > at > com.caucho.server.http.VirtualHost.service(VirtualHost.java:406) > at com.caucho.server.http.Request.dispatch(Request.java:211) > at > com.caucho.server.http.RunnerRequest.handleRequest(RunnerReque > st.java:307) > at > com.caucho.server.http.RunnerRequest.handleConnection(RunnerRe > quest.java:257 > ) > at com.caucho.server.TcpConnection.run(TcpConnection.java:139) > at java.lang.Thread.run(Thread.java:484) > > The code that calls parse is this. Its within this > Translator class I've > built: > /** > * Sets the states for all filterhandlers using the > * the servlet request and response objects then > * instructs the SAX parser to begin parsing the > * input stream using a stylesheet root for the translation > * > * @param deviceId The id of the device we're talking to > * @param is xml to translate > * @param os stream to send output > * @param ssr compiled stylesheet to use for translation > * @param req HttpServletRequest to be passed to filter handlers > * @param res HttpServletResponse to be passed to filter handlers > * @return void > * @throws org.xml.sax.SAXException, java.io.IOException > */ > public void process(InputStream is, > OutputStream os, StylesheetRoot ssr, > HttpServletRequest req, > HttpServletResponse res, > String encoding) > throws SAXException, IOException, Exception > { > setFilterStates(req, res); > processor.setOutputStream(os); > processor.setStylesheet(ssr); > // this won't really work... > processor.setStylesheetParam("encoding", > processor.createXString(encoding)); > parser.parse(new XSLTInputSource(is)); > reset(); > } > > I believe there may be issues with perhaps using the single > parser and processor multiple times and just resetting it. > That is what the reset() method does. "parser" is a Xerces > SAXParser and "processor" is an XSLTProcessor, both as > instance variables. Any suggestions as to why this is > throwing such an exception? > > Thanks! > > peter --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
