不支持的Ҏ异常。指明请求的Ҏ不被支持情况的异常?br />
异常
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /Login Q?/span>/Login是你的action名字Q?br />
可能原因
action没有再struts-config.xml 中定义,或没有找到匹配的actionQ例如在JSP文g中?nbsp;<html:form action="Login.do".表单提交给Login.do处理Q如果出Cq异常,h看struts-config.xml中的定义部分Q有时可能是打错了字W或者是某些不符合规则,可以使用strutsconsole工具来检查?br />
-----------------------------------------------------------------------------------------------------------------
异常
org.apache.jasper.JasperException: Cannot retrieve definition for form bean null
可能原因
q个异常是因为StrutsҎstruts-config.xml中的mapping没有扑ֈaction期望的form bean。大部分的情况可能是因ؓ在form-bean中设|的name属性和action中设|的name属性不匚w所致。换句话_action和form都应该各自有一个name属性,q且要精匹配,包括大小写。这个错误当没有name属性和action兌时也会发生,如果没有在action中指定name属性,那么没有name属性和action相关联。当然当action制作某些控制Ӟ譬如Ҏ参数D转到相应的jsp面Q而不是处理表单数据,q是׃用name属性,q也是action的用方法之一?br />
-----------------------------------------------------------------------------------------------------------------
异常
No action instance for path /xxxx could be created
可能原因
特别提示Q因为有很多中情况会Dq个错误的发生,所以推荐大家调高你的web服务器的日志/调试U别Q这样可以从更多的信息中看到潜在的、在试图创徏actioncL发生的错误,q个actioncM已经在struts-config.xml中设|了兌Q即d?/span><action>标签Q?br />
在struts-config.xml中通过action标签的class属性指定的actioncM能被扑ֈ有很多种原因Q例如:定位~译后的.class文gp|。Failure to place compiled .class file for the action in the classpath (在web开发中Qclass的的位置在r WEB-INF/classesQ所以你的action class必须要在q个目录下。例如你的actioncM于WEB-INF/classes/action/Login.class,那么在struts-config.xml中设|action的属性type时就是action.Login).
拼写错误Q这个也时有发生Qƈ且不易找刎ͼ特别注意W一个字母的大小写和包的名称?nbsp; -----------------------------------------------------------------------------------------------------------------
异常
javax.servlet.jsp.JspException: No getter method for property username of bean org.apache.struts.taglib.html.BEAN
可能原因
q个错误主要发生在在classpath中找不到相应的Java .class文g。如果这个错误发生在web应用E序的运行时Q主要是因ؓ指定的class文g不在web server的classpath中(/WEB-INF/classes ?nbsp;/WEB-INF/libQ。在上面的错误中Q原因是找不到ActionFormcR?br />
-----------------------------------------------------------------------------------------------------------------
异常
javax.servlet.jsp.JspException: Exception creating bean of class org.apache.struts.action.ActionForm: {1}
可能原因
Instantiating Struts-provided ActionForm class directly instead of instantiating a class derived off ActionForm. This mightoccur implicitly if you specify that a form-bean is this Struts ActionForm class rather than specifying a child of this classfor the form-bean.
Not associating an ActionForm-descended class with an action can also lead to this error. -----------------------------------------------------------------------------------------------------------------
异常
javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
可能原因
很显Ӟq个错误是发生在使用资源文gӞ而Struts没有扑ֈ资源文g?br />
Implicitly trying to use message resources that are not available (such as using empty html:options tag instead of specifyingthe options in its body --this assumes options are specified in ApplicationResources.properties file)
XML parser issues -- too many, too few, incorrect/incompatible versions -----------------------------------------------------------------------------------------------------------------
异常
Strange and seemingly random characters in HTML and on screen, but not in original JSP or servlet.
可能原因
混和使用Struts的html:form标记和标准的HTML标记不正?br />
使用的编码样式在本页中不支持?br />
-----------------------------------------------------------------------------------------------------------------
异常 "Document contained no data" in Netscape
No data rendered (completely empty) page in Microsoft Internet Explorer
可能原因
使用一个Action的派生类而没有实现perform()Ҏ或execute()Ҏ。在Struts1.0中实现的是perform()ҎQ在Struts1.1中实现的是execute()ҎQ但Struts1.1向后兼容perform()Ҏ。但你用Struts1.1创徏一个Action的派生类Qƈ且实Cexecute()ҎQ而你在Struts1.0中运行的话,׃得到"Document contained nodata" error message in Netscape or a completely empty (no HTML whatsoever) page rendered in Microsoft Internet Explorer.”的错误信息?br />
---------------------------------------------------------------------------------------------------------------------------
异常
ServletException: BeanUtils.populate
解决Ҏ
在用Struts上传文g?遇到了javax.servlet.ServletException: BeanUtils.populate异常?br />
我的ActionServletq没有用到BeanUtilsq些工具cR后来仔l检查代码发现是在jsp文g里的form忘了加enctype="multipart/form-data" 了。所以写E序遇到错误或异常应该从多方面考虑问题存在的可能性,惛_pȝ提示信息以外的东ѝ?br />
---------------------------------------------------------------------------------------------------------------------------- 1. 定义Action? 如果指定了name, 那么必须要定义一个与它同名的FormBean才能q行form映射.2. 如果定义Action? 提交面时出?nbsp;"No input attribute for mapping path" 错误, 则需要在其input属性中定义转向的页?3. 如果插入新的数据时出?nbsp;"Batch update row count wrong:" 错误, 则说明XXX.hbm.xml中指定的key的类型ؓ原始cd(int, long),因ؓq种cd会自动分配? 而这个值往往会让pȝ认ؓ已经存在该记? 正确的方法是使用java.lang.Integer或java.lang.Long对象.4. 如果插入数据时出?nbsp;"argument type mismatch" 错误, 可能是你使用了Date{特D对? 因ؓstruts不能自动从String型{换成Date?所? 你需要在Action中手动把String型{换成Date?5. Hibernate? Query的iterator()比list()Ҏ快很?6. 如果出现 "equal symbol expected" 错误, 说明你的strtus标签中包含另一个标{或者变? 例如: <html:select property="test" onchange="<%=test%>"/>
或?br />
<html:hidden property="test" value="<bean:write name="t" property="p"/>"/>
q样的情?img src="http://www.aygfsteel.com/Images/dot.gif" alt="" /> ---------------------------------------------------------------------------------------------------------------------------
错误QException in thread "main" org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update原因与解冻I 因ؓHibernate ToolsQ或者Eclipse本n的Database ExplorerQ生?/span>*.hbn.xml工具中包含有catalog="***"Q?/span>*表示数据库名Uͼq样的属?该属性删除就可以?br />
---------------------------------------------------------------------------------------------------------------------------
错误Qorg.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)
原因与解冻I
Ҏ1 删除Set方的cascade
Ҏ2 解决兌关系后,再删?br />
Ҏ3 在many-to-one方增加cascade 但g能是none
最后一招:
查一下hashCode equals是否使用了id作ؓ唯一标示的选项了;我用uuid.hex时是没有问题的;但是用了nativeQ就不行了,怎么办?删除啊! ----------------------------------------------------------------------------------------------------------------------------
问题Q今天用Tomcat 5.5.12Q发现原来很好用的系l不能用了,反复试发现面中不能包?nbsp;taglibQ否则会出现以下提示QHTTP Status 500-type Exception reportMessage description The server encountered an internal error () that prevented it from fulfilling this request.exceptionorg.apache.jasper.JasperException: /index.jsp(1,1) Unable to read TLD "META-INF/tlds/struts-bean.tld" from JAR file"file:*****/WEB-INF/lib/struts.jar":原因Q更C工程用的lib文g夹下的jarQ发布时也发布了servlet.jar和jsp-api.jar。解冻I把jsp-api.jar删除p册个问题了?/span>-----------------------------------------------------------------------------------------------------------------------------
错误Q?nbsp;java.lang.NullPointerException
原因Q?nbsp;发现 dao 实例?nbsp;manage 实例{需要注入的东西没有被注入(俗称I指针异常)解决Q这个时候,你应该查看日志文Ӟ默认是应用服务器?nbsp;log 文gQ比?nbsp;Tomcat 是 [Tomcat 安装目录 ]/logs Q你会发现提CZQ可能是Qorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sf' defined in ServletContextresource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception isorg.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xmlorg.hibernate.HibernateException: could not configure from URL: file:src/hibernate.cfg.xml……………………….Caused by: java.io.FileNotFoundException: src\hibernate.cfg.xml可能是:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined inServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception isorg.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not foundorg.hibernate.MappingException: Resource: com/mcc/coupon/model/UserRole.hbm.xml not found然后你就知道原因是因为配|文件的解析Z错误Q这个通过 Web 面是看不出来的。更多的是持久化影射文g出的错误Q导致了没有被解析;当然你需要的功能无法用了?br />
----------------------------------------------------------------------------------------------------------------------------
错误QStandardWrapperValve[action]: Servlet.service() for servlet action threw exception
javax.servlet.jsp.JspException: Cannot retrieve mapping for action /settlementTypeManage
或者: type Status report message Servlet action is not available description The requested resource (Servlet action is not available) is not available.
原因Q?nbsp;?nbsp;?br />
----------------------------------------------------------------------------------------------------------------------------
错误StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exceptionjava.lang.ClassNotFoundException: org.apache.struts.taglib.bean.CookieTei界面错误具体描述Q?br />
org.apache.jasper.JasperException: Failed to load or instantiate TagExtraInfo class: org.apache.struts.taglib.bean.CookieTei
原因与解冻I <Ҏ一>你的“html:”开头的标签没有攑֜一?/span><html:form>?nbsp; <Ҏ?/span>>重新启动你的应用服务器,自动没有这个问?/span>