刚学习Struts,自己写了个简单程序,一启动tomcat就报错,但是我按着ctrl点击struts.xml中com.struts.action.LoginAction也能定位到LoginAction类,自己弄了半天,网上找了好久终于搞定了!

控制台报错:
[color=#FF0000]Unable to load configuration. - action - file:/E:/tl/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2/WEB-INF/classes/struts.xml:11:82[/color]
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493)
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.<init>(ApplicationFilterConfig.java:107)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
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:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: Unable to load configuration. - action - file:/E:/tl/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2/WEB-INF/classes/struts.xml:11:82
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
... 14 more
Caused by: Action class [com.struts.action.LoginAction] not found - action - file:/E:/tl/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/struts2/WEB-INF/classes/struts.xml:11:82
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:486)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:556)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:295)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:264)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)

... 17 more

网上查找有以下解决方法:

1.检查action的name值和url中的大小写是否相同。
2.检查action中的class的路径名和你写的类名的大小写。

3.参照struts确定是否引入不必要的jar包,引发冲突(这个不好查到)。

这些都尝试依然不行,又搞了好久最后才弄好。。。。

1.在项目webRoot下面新建一个classes文件夹,把struts.xml拖到下面,可以正常使用,启动不再报错(但这个不是根本原因),

2.清理缓存,clean项目,记住是在eclipse->project->clean这里面clean,以前我都是在server部署过的tomcat上面右键clean,导致clean不彻底,因此才导致这个错误的。。。。。。。。。。。。。。。。。。。。。。

转自:https://blog.csdn.net/tomcat_2014/article/details/46136133

【转】Caused by: Action class [com.struts.action.xxxAction] not found 解决方法的更多相关文章

  1. 从js向Action传中文参数出现乱码问题的解决方法

    Action获取jsp表单中的中文参数,只要整个项目都采用UTF-8编码格式都不会出现乱码问题:但JSP中用到JS,并从JS向Action传中文参数,就会出现中文乱的现象     做项目的时候,发现A ...

  2. [Microsoft Dynamics CRM 2016]Invalid Action – The selected action was not valid 错误的诱因及解决方法

    详细问题描述: 由于解决windows server 评估版过期\SQL server 评估版过期的问题后而导致的Invalid Action – The selected action was no ...

  3. HTTP Status 404 - No result defined for action com.csdhsm.struts.action.LoginAction and result error

    智商拙计的问题,没有找到为类LoginAction和error找到定义,然后重新去struts.xml去看,我类个去,我居然把result写成了ERROR <result name=" ...

  4. Action请求后台出现Response already commited异常解决方法

    在编写导出功能使用action请求,在处理导出异常时期望跳转异常页,Controller中的方法返回类型String的url 在处理完逻辑导出文件后后台控制台出现 WARN  [org.springf ...

  5. Hive 0.12 Caused by: MetaException(message:Version information not found in metastore. )解决方法

    配置完成Mysql存储元数据信息,启动后测试show tables报错ERROR exec.DDLTask: org.apache.hadoop.hive.ql.metadata.HiveExcept ...

  6. Caused by: Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/classes/struts.xml:7:72 at com.opensymphony.xwork2.config.ConfigurationManager.getConfigurati

    Unable to load configuration. - action - file:/C:/apache-tomcat-7.0.70/webapps/Structs/WEB-INF/class ...

  7. 通常Struts框架会自动地从action mapping中创建action对象

    开发者不必在Spring中去注册action,尽管可以这么去做,通常Struts框架会自动地从action mapping中创建action对象 struts2-spring-plugin-x-x-x ...

  8. stuts1:(Struts)Action类及其相关类

    org.apache.struts.action.Action类是Struts的心脏,也是客户请求和业务操作间的桥梁.每个Action类通常设计为代替客户完成某种操作.一旦正确的Action实例确定, ...

  9. JavaEE中的MVC(五)定制Struts——Action跳转JSP

    在JavaEE中的MVC(三)中,我在Servlet中引入了命令模式的使用,采用Xml配置的方式,实现了一个Servlet调用多个不同的Action类,但是还不能实现页面地跳转,这一篇博客从之前的代码 ...

随机推荐

  1. MySQL日期数据类型总结

    MySQL:MySQL日期数据类型.MySQL时间类型使用总结 MySQL 日期类型:日期格式.所占存储空间.日期范围 比较. 日期类型        存储空间      日期格式           ...

  2. OpenNebula 深入分析

    -------------------OpenNebula 深入分析------------------- #容量清单 属性 描述 NAME 如果名字是空的,那么默认名字是:one-<VID&g ...

  3. HTML中meta标签的作用与使用

    META标签用来描述一个HTML网页文档的属性 META标签可分为两大部分:HTTP-EQUIV和NAME变量. HTTP实例 HTML代码实例中有一项内容是 <meta http-equiv= ...

  4. zigbee--绑定

    1.绑定是zigbee一种基本通信方式:具体绑定通信又分为3种模式,在这里只拿一种源绑定来说明. 源绑定: 发送模块 :必须要知道接收模块(被绑定模块)的网络地址或者MAC地址 接收方的接收端点 接收 ...

  5. 单个控件textbox只支持在英文状态下输入所需的字符串

    也就是它的属性: Imemode的属性 设置成off就可以了 ,就不会受到所输入的中文汉字了.

  6. Displaying Speed and Direction Symbology from U and V vectors (转)

    This blog shows you how to calculate and symbolize wind or current speed and direction when the unde ...

  7. 数组Byte [] 和 string 相互转换

    using System; using System.Collections.Generic; using System.Text; namespace NET.MST.Fourth.StringBy ...

  8. Java Script 脚本的几种基本格式:

    1. <script>       document.Write("Hello wrrld!!!");     </script> 2. <scrip ...

  9. 【kudu pk parquet】TPC-H Query2对比解析

    这是[kudu pk parquet]的第二篇,query2在kudu和parquet上的对比解析,其中kudu包含有不能下发的谓词. 3台物理机,1T规模的数据集,impala和kudu版本是我们修 ...

  10. Can't install Solaris 10 on XenServer 6.5 VM

    I have XenServer 6.5 installed on a server, and i have been trying to install Solaris 10 on a VM, it ...