scala-xml
scala-xml copied to clipboard
Concurrent modification exception under XML.load
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)
Imported From: https://issues.scala-lang.org/browse/SI-4836?orig=1 Reporter: Nathan (n8han)
@SethTisue said: The scala-xml library is now community-maintained. Issues with it are now tracked at https://github.com/scala/scala-xml/issues instead of here in the Scala JIRA.
Interested community members: if you consider this issue significant, feel free to open a new issue for it on GitHub, with links in both directions.
Is this problem fixed? I can't find the corresponding ticket in the scala-xml repo. 🤔
Is this problem fixed?
it nearly certainly isn't
I'll transfer the issue. In 2015, that capability didn't exist on GitHub.
Thanks @SethTisue :)