问题描述
<form name="form1" method="post" action="issue.action"><table width="100%" border="0" id="login"><tr><td colspan="2">题目:<input name="title" type="text" id="title">所属省份: <label><select name="province" id="province"><option value="河南省">河南省</option><option value="北京">北京</option></select></label>标签: <select name="tag" id="tag"> <option value="无">所属科目</option><option value="政治">政治</option><option value="高数">高数</option><option value="英语">英语</option></select>板块: <select name="board" id="board"><option value="11">普通高校</option><option value="12">民办高校</option></select></td></tr><tr><td width="85%"><label>来源:<input type="text" name="origin" id="origin"></label><label>来源URL:<input type="text" name="originurl" id="originurl"></label></td><td width="15%"><input type="reset" name="reset" id="reset" value="重置"></td></tr><tr><td colspan="2" align="center"><FCK:editor instanceName="matter" toolbarSet="adminDefault"><jsp:attribute name="value">信息发布</jsp:attribute></FCK:editor></td></tr><tr><td colspan="2" align="center"><input type="submit" name="submit" id="submit" value="提交"></td></tr></table></form>Issue.action类 import java.util.Map;import org.apache.struts2.interceptor.SessionAware;import com.all.dao.AdminDao;import com.all.dao.TopicDao;import com.all.entity.TopicEntity;import com.opensymphony.xwork2.Action;import com.opensymphony.xwork2.ActionSupport;public class IssueAction extends ActionSupport implements SessionAware{/** * 文章发表 Action */private static final long serialVersionUID = -3238385317493022591L;TopicDao td = new TopicDao();AdminDao ad=new AdminDao();private TopicEntity topic;@SuppressWarnings("unchecked")private Map session;public TopicEntity getTopic() {return topic;}public void setTopic(TopicEntity topic) {this.topic = topic;}public String execute() throws Exception {//topic.setSaid(ad.getId((String)session.get("adminName")));//topic.setSaid(1);System.out.print(session.get("adminName"));if (td.insertTopic(topic) == 1) {return Action.SUCCESS;} else {//System.out.println(ad.getId((String)session.get("adminName")));return Action.ERROR;}}@SuppressWarnings("unchecked")public void setSession(Map session) {this.session=session;}}提示错误:Action class [cn.cstp.org.action.LoginAction] not found - action - file:/E:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/test-scope/WEB-INF/classes/struts.xml:7:67at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)at org.apache.catalina.core.StandardService.start(StandardService.java:448)at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)at org.apache.catalina.startup.Catalina.start(Catalina.java:552)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413) 问题补充:LeeYee 写道
解决方案
异常信息中的“包名”都没有楼主所定义的,是配置的问题,请检查struts.xml
解决方案二:
struts.xml配置文件文件错误!
解决方案三:
明显的配置问题
解决方案四:
http://chenxiang105.iteye.com/blog/729128
解决方案五:
这种错误一看就明白了。自己肯定能解决的
解决方案六:
引用E:/Program Files/Apache Software Foundation/Tomcat 6.0/webapps/test-scope/WEB-INF/classes/struts.xml:7:67 首先检查你的配置文件struts.xml文件中第7行第67列,是什么东西?看看是不是这个地方配置文件写错了。如果是cn.cstp.org.action.LoginAction,检查包名是否和你的Action中的包名一致,如果一致,检查你的tomcat中/webapps/test-scope/WEB-INF/classes/cn/cstp/org/action/LoginAction.class 这个class文件是否存在,如果不存在,说明你的Action没有编译,需要手工编译。然后再重新发布,启动tomcat,再试试!
解决方案七:
引用Action class [cn.cstp.org.action.LoginAction] not found - action 在struts.xml配置的cn.cstp.org.action.LoginAction类存在么?
解决方案八:
你首先看下出错提示 Action class cn.cstp.org.action.LoginAction not found 你看下发布后的文件 和 发布前你项目编译的文件 是不是没有编译? FCK 可以设置 id 属性在JSP页面中你可以这样获取 <%String content = request.getParameter("content");out.print(content);%>
解决方案:
检查你的配置文件 test-scope/WEB-INF/classes/struts.xml