Java 在Tomcat 8.0上初始化struts应用程序时出错
这就是我在Tomcat8.0上运行Struts应用程序时遇到的错误 在应用程序构建路径和web部署程序集中包含Struts库之后,我使用DynamicWebProject的基本流程配置了我的应用程序 这是我的web.xml:Java 在Tomcat 8.0上初始化struts应用程序时出错,java,tomcat,struts,Java,Tomcat,Struts,这就是我在Tomcat8.0上运行Struts应用程序时遇到的错误 在应用程序构建路径和web部署程序集中包含Struts库之后,我使用DynamicWebProject的基本流程配置了我的应用程序 这是我的web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.o
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts(XML Based)</display-name>
<!-- Declaration of the Struts 2 filter. Since our entire web application will be a Struts 2
application, we will not have any other servlets or filters. Of course, real Struts 2
applications may also have other servlets or filters, but since we are doing only Struts 2
stuff in this example, we need only define the Struts 2 filter. -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
Struts(基于XML)
支柱2
org.apache.struts2.dispatcher.FilterDispatcher
支柱2
/*
index.html
以下是异常和堆栈跟踪:
java.util.concurrent.executionexception:
org.apache.catalina.lifecycleexception:无法启动组件
[standardengine[catalina].standardhost[localhost].standardcontext[/struts]]
位于java.util.concurrent.futuretask.report(未知源)
java.util.concurrent.futuretask.get(未知源代码)位于
org.apache.catalina.core.containerbase.startinternal(containerbase.java:945)
在
org.apache.catalina.core.standardhost.startinternal(standardhost.java:871)
在
org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:145)
在
org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1410)
在
org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1400)
位于java.util.concurrent.futuretask.run(未知源代码)
位于的java.util.concurrent.threadpoolexecutor.runworker(未知源)
java.util.concurrent.threadpoolexecutor$worker.run(未知源代码)位于
java.lang.thread.run(未知源)由以下原因引起:
org.apache.catalina.lifecycleexception:无法启动组件
[standardengine[catalina].standardhost[localhost].standardcontext[/struts]]
在
org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:162)
... 6其他原因:java.lang.noclassdeffounderror:
lcom/opensymphony/xwork2/util/logging/logger;在
位于的java.lang.class.getdeclaredfields0(本机方法)
位于的java.lang.class.privategetdeclaredfields(未知源)
位于的java.lang.class.getdeclaredfields(未知源)
org.apache.catalina.util.introspection.getdeclaredfields(introspection.java:106)
在
org.apache.catalina.startup.webannotationset.loadfieldsannotation(webannotationset.java:267)
在
org.apache.catalina.startup.webannotationset.loadapplicationfilterannotations(webannotationset.java:107)
在
org.apache.catalina.startup.webannotationset.loadapplicationannotations(webannotationset.java:66)
在
org.apache.catalina.startup.contextconfig.applicationannotationsconfig(contextconfig.java:336)
在
org.apache.catalina.startup.contextconfig.configurestart(contextconfig.java:776)
在org.apache.catalina.startup.conte
你的问题缺乏细节。到目前为止你试过什么?您正在使用哪些技术/语言?你是怎么做的?编辑您的问题并添加这些详细信息<代码>java.lang.noclassdeffounderror:lcom/opensymphony/xwork2/util/logging/logger代码>。看来你缺少依赖项了。多亏了你。首先,问题是xwork jar版本。我将jar改为xwork-core2.2.3.jar,一切正常。