Tomcat的StandAlone部署无法正常工作

时间:2014-03-14 07:10:56

标签: tomcat

Mar 14, 2014 12:04:59 AM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/tcs/Downloads/apache-tomcat-7.0.52 2/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)

每次尝试调出tomcat服务器时,我都会收到以下异常。 不确定是什么导致了这一点。

我已经下载了tomcat的服务器版本,只是尝试为localhost启动服务器。

完成StackTrace如下:

$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)



   Using CATALINA_BASE:   /Users/abc/Desktop/apache-tomcat-7.0.52
Using CATALINA_HOME:   /Users/abc/Desktop/apache-tomcat-7.0.52
Using CATALINA_TMPDIR: /Users/abc/Desktop/apache-tomcat-7.0.52/temp
Using JRE_HOME:        /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home
Using CLASSPATH:       /Users/abc/Desktop/apache-tomcat-7.0.52/bin/bootstrap.jar:/Users/abc/Desktop/apache-tomcat-7.0.52/bin/tomcat-juli.jar
Mar 17, 2014 2:23:39 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /Users/abc/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
Mar 17, 2014 2:23:40 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Mar 17, 2014 2:23:40 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1061 ms
Mar 17, 2014 2:23:40 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Mar 17, 2014 2:23:40 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.52
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/abc/Desktop/apache-tomcat-7.0.52/webapps/docs
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/abc/Desktop/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

Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/abc/Desktop/apache-tomcat-7.0.52/webapps/examples
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/abc/Desktop/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)

Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/abc/Desktop/apache-tomcat-7.0.52/webapps/host-manager
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/abc/Desktop/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)

Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/abc/Desktop/apache-tomcat-7.0.52/webapps/manager
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/abc/Desktop/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)

Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /Users/abc/Desktop/apache-tomcat-7.0.52/webapps/ROOT
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.HostConfig deployDirectory
SEVERE: Error deploying web application directory /Users/abc/Desktop/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)

Mar 17, 2014 2:23:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Mar 17, 2014 2:23:40 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Mar 17, 2014 2:23:40 PM org.apache.catalina.startup.Catalina start

1 个答案:

答案 0 :(得分:1)

您有不同Tomcat版本的JAR混淆了。删除所有当前的Tomcat安装并执行完全干净的安装。