部署struts2项目到Tomcat服务器中报错:Dispatcher initialization failed 以及 Tomcat 始终加载同一个项目的web.xml配置文件信息

严重: Dispatcher initialization failed
Unable to load configuration. - action - file:/E:/apache-tomcat-7.0.85/webapps/StrutsDemo/WEB-INF/classes/struts.xml:11:52
...
Caused by: Action class [gz.itcast.TestAction] not found - action - file:/E:/apache-tomcat-7.0.85/webapps/StrutsDemo/WEB-INF/classes/struts.xml:11:52
...
... 20 more
2018-5-16 21:53:03 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Unable to load configuration. - action - file:/E:/apache-tomcat-7.0.85/webapps/StrutsDemo/WEB-INF/classes/struts.xml:11:52
...
Caused by: Unable to load configuration. - action - file:/E:/apache-tomcat-7.0.85/webapps/StrutsDemo/WEB-INF/classes/struts.xml:11:52
...
Caused by: Action class [gz.itcast.TestAction] not found - action - file:/E:/apache-tomcat-7.0.85/webapps/StrutsDemo/WEB-INF/classes/struts.xml:11:52
...
2018-5-16 21:53:03 org.apache.catalina.core.StandardContext startInternal
严重: One or more Filters failed to start. Full details will be found in the appropriate container log file
2018-5-16 21:53:03 org.apache.catalina.core.StandardContext startInternal
严重: Context [/StrutsDemo] startup failed due to previous errors

2018-5-16 21:53:03 org.apache.catalina.startup.HostConfig deployDirectory


解决:1)每次我部署的是其它的项目(比如struts2_3),但是错误信息中却说不能加载 StrutsDemo 的配置文件(StrutsDemo 是之前别的项目),同时我发现以前好使的struts项目突然都变得不好使了,显然是Tomcat的问题,直接卸载重新关联到MyEclipse上去即可
  2)如果不是Tomcat的问题,那么结合网上的答案,在struts.xml的Package标签中加入extends="struts-default"属性即可

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值