Computing Magazine

JAXB Error : FWK005 Parse May Not Be Called While Parsing

Posted on the 20 August 2014 by Abhishek Somani @somaniabhi

org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
Above Error occurs because you might have SchemaFactory instance , which is shared by multiple threads. Like declaring it at class level , and using it in methods .

private SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
The SchemaFactory is not thread safe . It should always be initialized and accessed in local scope. So whenever you need SchemaFactory instance , just create it locally instead of using it at instance level.Post Comments And Suggestions !! JAXB Error : FWK005 parse may not be called while parsing

Back to Featured Articles on Logo Paperblog

Magazines