tags:

views:

176

answers:

3

I get this message :

javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImp

but i can't seem to solve the problem. I have googled, but can't find any good solutions.

Does anyone have an idea of what could be wrong? And maybe how to solve it :)

+1  A: 

The org.apache.xerces is from the Apache Xerces package, and something in your application has a dependency on it. Try downloading it (latest version is 2.9.0) and adding it to your application's classpath.

skaffman
A: 

As you've tagged your question JBoss, I'll assume your code is running in the JBoss container.

JBoss may have already loaded a version of Xerces for it's own use and you're trying to load a different version in your code (either explicitly or through some dependency) and the configuration for your version is not compatible with the version that's already loaded.

This JIRA Ticket on JBoss.org suggests deleting the xercesimpl.jar in jasperserver/WEB-INF/lib folder to allow your version to be used.

Robert Christie
Thank you for the comment.I am running the code in the JBoss container.I must also add that i am pretty new to JBoss. I can't find the folder "jasperserver/WEB-INF/lib" in my JBoss folder, but it can locate the file "xercesimpl.jar" in jboss/lib/endorsed.Do you think it is any luck with deleting that file?
A: 

DocumentBuilderFactory has a multi-step process for finding the actual parser implementation, as described in the linked JavaDoc. Your error message is almost certainly coming from there.

I suspect that your JBoss startup script is setting the javax.xml.parsers.DocumentBuilderFactory system property incorrectly (I've seen this happen before, used to avoid a bug in the released library). I would start by grepping the JBoss configuration directory for that property, followed by explicitly setting the jaxp.debug property (also described in the link). Assuming that your startup script is indeed explicitly setting the property, find out who made that change and ask him/her if you can delete it (or to provide you with the correct JARs if not).

kdgregory