5 Replies Latest reply on Jun 27, 2017 7:04 AM by Arul Antonysamy

    No available JAR files in the classpath define the class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

    justin.kenel Newbie

      A bit of background - I'm in the midst of migrating something from JBoss AS 5.1 to JBoss AS 7.1 and have come across this problem when starting the server.

       

      I'm haivng a problem in some parts of an application using the Xerces library - JBoss claims that it is not in the classpath. I have done no configuration specifically for the Xerces library, and this same error occurs whether I have xercesImpl.jar in the lib/ or not.

       

      The full stack trace is:

       

      18:02:12,902 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/ae]] (MSC service thread 1-10) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/conf/spring-baseApplicationContext.xml]; nested exception is javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__DocumentBuilderFactory could not be instantiated: java.lang.IllegalStateException: Could not find JAXP implementation using classloader=ModuleClassLoader for Module "deployment.suite.ear:main" from Service Module Loader. No available JAR files in the classpath define the class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:131) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:522) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:436) [spring-context-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:384) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [spring-web-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

              at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

              at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

              at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_27]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_27]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_27]

      Caused by: javax.xml.parsers.FactoryConfigurationError: Provider __redirected.__DocumentBuilderFactory could not be instantiated: java.lang.IllegalStateException: Could not find JAXP implementation using classloader=ModuleClassLoader for Module "deployment.suite.ear:main" from Service Module Loader. No available JAR files in the classpath define the class org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

              at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:129) [rt.jar:1.6.0_27]

              at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:89) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388) [spring-beans-3.1.0.RELEASE.jar:3.1.0.RELEASE]

              ... 21 more

       

      I am using JBoss-as-7.1.1.Final. Has this error been seen? I've tried searching for a solution, an am aware of similar bugs that have existed in past JBoss AS products. Is there a way to force the jar to be in the class path, whether it's JBoss AS deployed jar or my own?