Skip to content

Concurrent modification exception under XML.load #459

Open
@scabug

Description

@scabug

Dispatch user reported this bug: https://github.com/n8han/Databinder-Dispatch/issues/33

Dispatch is using the load method of the XML singleton object from potentially many threads. The stack trace suggests that the the static method SAXParserFactory.newInstance called in XML.load -> XMLLoader.loadXML is not thread safe. This factory should only be instantiated one time and the instance retained for all calls to newSAXParser; otherwise, if the factory itself is rebuilt on each call to XML.load it will need to be synchronized.

caught javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl could not be instantiated: java.util.ConcurrentModificationException
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl could not be instantiated: java.util.ConcurrentModificationException
at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:134)
at scala.xml.factory.XMLLoader$class.parser(XMLLoader.scala:28)
at scala.xml.XML$.parser(XML.scala:40)
at scala.xml.factory.XMLLoader$class.load(XMLLoader.scala:53)
at scala.xml.XML$.load(XML.scala:40)
at dispatch.HandlerVerbs$$anonfun$$less$greater$1.apply(handlers.scala:88)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions