gpt4 book ai didi

java - Maven war - 无法启动组件 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/] 构建 Maven war

转载 作者:太空宇宙 更新时间:2023-11-04 07:31:31 30 4
gpt4 key购买 nike

我在网上搜索了答案,但我发现的一切都没有任何帮助。问题是这样的:动态Web项目已转换为maven项目,并将其部署到tomcat7工作得很好,但是在从同一项目构建war文件并尝试运行相同的文件后,我收到了org.apache.catalina.LifecycleException。我相信我的所有依赖项都已就位,因此我认为这不是 Maven 的问题,而是 Maven 编译器的问题。此外,虽然从同一个项目中构建 war,但在 tomcat 上运行得很好,但通过 Maven 构建则不行。这是堆栈跟踪:

`Jul 12, 2013 11:39:27 AM 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: C:\Program Files (x86)\Java\jdk1.6.0_43\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files (x86)/Java/jre7/bin/client;C:/Program Files (x86)/Java/jre7/bin;C:/Program Files (x86)/Java/jre7/lib/i386;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\OpenVPN\bin;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;D:\install\apache-maven-3.0.5\bin;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\;D:\install\apache-ant-1.9.1-bin\apache-ant-1.9.1\bin;C:\Program Files (x86)\Java\jdk1.6.0_43\bin;c:\Program Files (x86)\Java\jdk1.6.0_43\bin;D:\install\eclipse-jee-juno-SR2-win32\eclipse;;.
Jul 12, 2013 11:39:27 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
Jul 12, 2013 11:39:27 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Jul 12, 2013 11:39:27 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 295 ms
Jul 12, 2013 11:39:27 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 12, 2013 11:39:27 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
Jul 12, 2013 11:39:27 AM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive D:\install\apache-tomcat-7.0.40\webapps\RQM-WEB-MVN-0.0.1-SNAPSHOT.war
Jul 12, 2013 11:39:36 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/RQM-WEB-MVN-0.0.1-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
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:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1654)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError: LLog;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2300)
at java.lang.Class.getDeclaredFields(Class.java:1745)
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.loadApplicationListenerAnnotations(WebAnnotationSet.java:90)
at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:65)
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:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: java.lang.ClassNotFoundException: Log
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
... 25 more
Jul 12, 2013 11:39:36 AM org.apache.catalina.startup.HostConfig deployWAR
SEVERE: Error deploying web application archive D:\install\apache-tomcat-7.0.40\webapps\RQM-WEB-MVN-0.0.1-SNAPSHOT.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/RQM-WEB-MVN-0.0.1-SNAPSHOT]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1654)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
Jul 12, 2013 11:39:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\install\apache-tomcat-7.0.40\webapps\host-manager
Jul 12, 2013 11:39:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\install\apache-tomcat-7.0.40\webapps\manager
Jul 12, 2013 11:39:36 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\install\apache-tomcat-7.0.40\webapps\ROOT
Jul 12, 2013 11:39:36 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
Jul 12, 2013 11:39:36 AM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Jul 12, 2013 11:39:36 AM org.apache.catalina.startup.Catalina start
INFO: Server startup in 8855 ms
`

pom.xml 太大了,它不适合,因此无法发布它,但我真的相信所有依赖项都已就位......我们将不胜感激!

这些是我的插件:

        <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>WEB-INF/lib/maven*.jar</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.2</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.1</version>
</plugin>
</plugins>

最佳答案

经过几天的努力,终于弄清楚问题所在了。我认为这可能会帮助其他有类似问题的人。构建 .war 文件(通过 m2e-wtp 或控制台 mvn 包)后,maven 编译器从 src/main/webapp/WEB-INF/classes 文件夹而不是目标文件夹(target/projectName/WEB-INF/classes)中提取 java 类,从而报告导入错误,从而导致将 .war 文件部署到 tomcat 时出错。因此,只需从 WEB-INF 文件夹中删除 classes 文件夹,maven 就会处理它。

关于java - Maven war - 无法启动组件 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/] 构建 Maven war ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17612601/

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