小编典典

Tomcat 7启动问题:无法初始化类org.apache.tomcat.util.descriptor.DigesterFactory

tomcat

好的。有一次我让Tomcat(7)运行良好。现在不是。我不知道我可能搞砸了。(但是我认为这是在我在NetBeans中设置一个Web项目以与Tomcat一起使用时发生的。)

我在OS X 1.8.5上,使用Java 1.7.0_51。

我的catalina.out看起来像这样:

Feb 23, 2014 5:42:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.
Feb 23, 2014 5:42:57 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Feb 23, 2014 5:42:57 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1e 11 Feb 2013)
Feb 23, 2014 5:42:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-8089"]
Feb 23, 2014 5:42:58 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1761 ms
Feb 23, 2014 5:42:58 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 23, 2014 5:42:58 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/docs
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/docs
java.lang.ExceptionInInitializerError
    at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
    at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
    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:110)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
    at org.apache.tomcat.util.descriptor.DigesterFactory.idFor(DigesterFactory.java:107)
    at org.apache.tomcat.util.descriptor.DigesterFactory.<clinit>(DigesterFactory.java:59)
    ... 18 more

Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/examples
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/examples
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
    at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
    at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
    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:110)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/host-manager
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/host-manager
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
    at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
    at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
    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:110)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/manager
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/manager
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
    at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
    at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
    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:110)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/ROOT
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/Edvard/Downloads/apache-tomcat-7.0.52/webapps/ROOT
java.lang.NoClassDefFoundError: Could not initialize class org.apache.tomcat.util.descriptor.DigesterFactory
    at org.apache.catalina.startup.ContextConfig.createWebXmlDigester(ContextConfig.java:515)
    at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:836)
    at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:382)
    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:110)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1229)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

Feb 23, 2014 5:42:58 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-apr-8089"]
Feb 23, 2014 5:42:58 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-apr-8009"]
Feb 23, 2014 5:42:58 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 409 ms

我尝试重新安装Tomcat,但问题仍然存在。我将非常感谢我能得到的任何指导。


阅读 265

收藏
2020-06-16

共1个答案

小编典典

我也遇到了同样的问题。您可能已经下载了自己的servlet.jar文件,而不是使用tomcat的文件。检出/ Library / Java /
Extensions /文件夹(或放置jar文件的任何文件夹),然后删除servlet.jar文件。卡塔琳娜跑了,现在应该可以工作了

2020-06-16