-1

我正在使用 Eclipse 在 Apache Tomcat 服务器上部署应用程序修复服务,但问题似乎是应用程序没有被复制到 webapps 文件夹中,即它没有被发布。

HTTPConnectionManager 类已经存在于构建路径的 jar 中。

Sep 09, 2013 1:24:46 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading Context with name [/repair-service] has started
Sep 09, 2013 1:25:01 PM org.apache.catalina.core.StandardContext reload
SEVERE: Exception starting Context with name [/repair-service]
org.apache.catalina.LifecycleException: Failed to start component 

    [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/repair-service]]
        `enter code here`at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:3926)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1271)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1440)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:301)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1530)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1540)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1519)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/httpclient/HttpConnectionManager
        at java.lang.Class.getDeclaredFields0(Native Method)
        at java.lang.Class.privateGetDeclaredFields(Unknown Source)
        at java.lang.Class.getDeclaredFields(Unknown Source)
        at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
        at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:261)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:140)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:67)
        at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:405)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5179)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        ... 11 more
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpConnectionManager
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
        ... 25 more

    Sep 09, 2013 1:25:01 PM org.apache.catalina.core.StandardContext reload
    INFO: Reloading Context with name [/repair-service] is completed
4

1 回答 1

0

只是检查一下,你的类路径中有 Apache HTTP 客户端的 jar 吗?如果没有,请添加并尝试再次部署应用程序。

编辑 确保在“项目属性>部署程序集”中选择了您的库。另一种选择是将依赖项放在 Tomcat 库目录中。

于 2013-09-09T17:48:09.840 回答