java.lang.ClassNotFoundException:org / apache / xerces / jaxp / DocumentBuilderFactoryImpl
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java.lang.ClassNotFoundException:org / apache / xerces / jaxp / DocumentBuilderFactoryImpl相关的知识,希望对你有一定的参考价值。
我正在启动一个基于java和tomcat的应用程序。我收到以下错误。
Dec 08, 2015 12:04:00 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '50' did not find a matching property.
Dec 08, 2015 12:04:00 PM org.apache.catalina.startup.SetAllPropertiesRule begin
WARNING: [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'maxSpareThreads' to '50' did not find a matching property.
Dec 08, 2015 12:04:01 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'Server/Service/Realm'.
Dec 08, 2015 12:04:01 PM org.apache.tomcat.util.digester.Digester endElement
WARNING: No rules found matching 'Server/Service/Host'.
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:200)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:152)
at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:232)
at javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:120)
at org.apache.catalina.core.JreMemoryLeakPreventionListener.lifecycleEvent(JreMemoryLeakPreventionListener.java:431)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
at org.apache.catalina.startup.Catalina.load(Catalina.java:576)
at org.apache.catalina.startup.Catalina.load(Catalina.java:599)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:310)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:484)
Caused by: java.lang.ClassNotFoundException: org/apache/xerces/jaxp/DocumentBuilderFactoryImpl
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at javax.xml.parsers.FactoryFinder.getProviderClass(FactoryFinder.java:124)
at javax.xml.parsers.FactoryFinder.newInstance(FactoryFinder.java:188)
... 16 more
我检查了所有配置文件。任何领导都表示赞赏。
答案
得到这个,看起来它是由运行catalina -javaagent=...
奇怪的命令中使用“java代理”引起的。给我们
Caused by: java.lang.ClassNotFoundException: org/apache/xerces/jaxp/DocumentBuilderFactoryImpl
有时也给我们这个:
Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: org.apache.logging.log4j.jcl.LogFactoryImpl (Caused by java.lang.ClassNotFoundException: org.apache.logging.log4j.jcl.LogFactoryImpl)
at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1276)
at org.apache.commons.logging.LogFactory$2.run(LogFactory.java:1065)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:1062)
at org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:497)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:685)
at org.apache.struts.validator.DynaValidatorForm.<clinit>(DynaValidatorForm.java:97)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.jcl.LogFactoryImpl
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
at org.apache.commons.logging.LogFactory.createFactory(LogFactory.java:1131)
... 37 more
修复:暂时删除java代理参数,然后启动良好。可能的修复:使它可以登录到其日志文件(权限)?
以上是关于java.lang.ClassNotFoundException:org / apache / xerces / jaxp / DocumentBuilderFactoryImpl的主要内容,如果未能解决你的问题,请参考以下文章