2 qq 37189793 qq_37189793 于 2017.09.15 11:12 提问

struts2中莫名其妙的错误

严重: Exception starting filter struts2
Unable to load configuration. - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/test2/WEB-INF/classes/struts.xml:8:89
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4746)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5399)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
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: Unable to load configuration. - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/test2/WEB-INF/classes/struts.xml:8:89
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
... 14 more
Caused by: Action class [com.chinasoft.app.action.UserAction] not found - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/test2/WEB-INF/classes/struts.xml:8:89
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:482)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:426)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:552)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 16 more

4个回答

qq_37189793
qq_37189793   2017.09.15 11:14

struts.xml文件没有问题 ,我是先运行了一个工程,然后又运行了另一个工程 ,struts.xml是复制过去改的,然后就出这么个错

qq_28215471
qq_28215471   2017.09.15 11:16

图片说明
这个action的路径是不是错了。

qq_37189793
qq_37189793 谢谢大哥
2 个月之前 回复
qq_37189793
qq_37189793 好像 真的是 尴尬尴尬尴尬
2 个月之前 回复
zzj123456qaz
zzj123456qaz   2017.09.15 11:21

Unable to load configuration. - action - file:/D:/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/test2/WEB-INF/classes/struts.xml:8:89

你那个xml 里的文件配错了,有些路径你是不是跟你的项目路径等等不一样,所以他导致了项目在运行的时候第一次进行初始化的时候就报错了,你先把xml的文件拷上去,然后把路径换成你自己的就可以了,不是什么大问题。。

qq_37189793
qq_37189793 懂了 ,谢谢大哥
2 个月之前 回复
qq_40212465
qq_40212465   2017.09.15 11:39

要看Caused by,英语不好吧

qq_37189793
qq_37189793 蛤蛤蛤 被发现了
2 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片