File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes SAXException within Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "SAXException within Servlet" Watch "SAXException within Servlet" New topic

SAXException within Servlet

Richard Lawrence

Joined: Jan 22, 2002
Posts: 10
Hi all,
I keep get the following error within my servlet
on trying to parse an xml document.
(i.e Some times it works)
The error message is:-
Error in getDocument rg.xml.sax.SAXException: FWK005 parse may not be called while parsing.
The following is part of the code:-
import org.apache.xerces.parsers.DOMParser;
DOMParser parser = new DOMParser();

public Document getDocument(String inXML) throws Exception
StringReader stringReader =
new StringReader(inXML);
InputSource inSource =
new InputSource(stringReader);
return parser.getDocument();
The xml string that i'm sending in is:-
<?xml version="1.0" ?><OrderStatus OrderNo="NW6661" EnterpriseCode="NETV"/>
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
This error message usually shows up when one parse() method invocation oversteps a parsing process in progress. For instance, when there is an attempt to invoke the
parse method on a parser object while another parse (with the same parser
object) is still in progress.
This can happen for example, when multiple threads sharing the same parser instance try to invoke the parse() method. Check your code for such scenarios. If nothing helps, you can simply wrap the parse() call within a synchronized method.
Hope that helps.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: SAXException within Servlet
It's not a secret anymore!