gpt4 book ai didi

tomcat - 由于 NoClassDefFoundError : org/apache/commons/configuration/ConfigurationFactory,无法启动 Tomcat

转载 作者:行者123 更新时间:2023-11-28 23:15:40 24 4
gpt4 key购买 nike

我们的应用程序目前在 Java 8 上运行,但我们有运行 Java 6 的旧版本。当我检查这些旧分支之一时,刷新我的 Maven 存储库,清理工作区 (Eclipse IDE),等等,做我所有的事情倾向于在版本发生重大变化时让我们的应用程序在本地运行,我在启动 tomcat 时遇到错误:

    SEVERE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssplus]]
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1239)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:819)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1700)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1690)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/ssplus]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:162)
... 6 more
Caused by: java.lang.NoClassDefFoundError: Lorg/apache/commons/configuration/ConfigurationFactory;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2583)
at java.lang.Class.getDeclaredFields(Class.java:1916)
at org.apache.catalina.util.Introspection.getDeclaredFields(Introspection.java:106)
at org.apache.catalina.startup.WebAnnotationSet.loadFieldsAnnotation(WebAnnotationSet.java:270)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationServletAnnotations(WebAnnotationSet.java:139)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:417)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:891)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:388)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5519)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.commons.configuration.ConfigurationFactory
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
... 20 more

我在工作区中没有任何错误,Commons Configuration jar 在我的 maven 存储库中。关于可能是什么问题的任何想法?

最佳答案

Tomcat 的 classpath 可能不包含您的 webapp 所需的 jars

试试这个:

右键单击您的动态 Web 项目 -> 构建路径 -> 配置构建路径 -> 部署程序集(在左侧列表中) -> 添加 -> Java 构建路径条目 -> 下一步 -> (按 ctrl A 全选) ->完成

现在重新启动您的服务器。可能只是为你做。

关于tomcat - 由于 NoClassDefFoundError : org/apache/commons/configuration/ConfigurationFactory,无法启动 Tomcat,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49899276/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com