ognl.MethodFailedException: Method "setXX" failed for object
2010-05-12 10:03
405 查看
由于数据类型不匹配而导致的异常
可以debug 通过查看 ognl.Ognl.java 类中的setValue()源代码 查找问题
ognl.MethodFailedException: Method "setId" failed for object cn.xyurp.system.bean.DomainValue@1a6d030 [java.lang.NoSuchMethodException: setId([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964) at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75) at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.ASTChain.setValueBody(ASTChain.java:172) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198)
可以debug 通过查看 ognl.Ognl.java 类中的setValue()源代码 查找问题
public static void setValue( Object tree, Map context, Object root, Object value ) throws OgnlException { OgnlContext ognlContext = (OgnlContext)addDefaultContext(root, context); Node n = (Node) tree; n.setValue( ognlContext, root, value ); } // n 既是 JSP页面 form 表单中的 input 元素 的name 属性 比如 <input name="user.username" value="123"/> 然后在 ognl 中 通过action 中的 setter 方法 将调用 ognl.Ognl.java 中的 上述方法: n ==> user.username value ==> 123
相关文章推荐
- 图片上传出现错误提示ognl.MethodFailedException: Method "setUpload" failed for object
- ognl.MethodFailedException: Method "setRemainig" failed for object
- 解决ognl.MethodFailedException: Method "list" failed for object com.szy.ResourceAction的问题
- ognl.MethodFailedException: Method "setEndtime" failed for object com.piptrade.action.tradetools.eCa
- ognl.MethodFailedException: Method "setDate" failed for object解决
- ognl.MethodFailedException: Method "setId" failed for object Itemer/org.springframework.orm.hibernat
- 进行修改时,发现记录不完整及ognl.MethodFailedException: Method "delete" failed for object cn.chenbiao.house.web.ac
- org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object
- org.apache.ibatis.ognl.MethodFailedException: Method "size" failed for object
- ognl.MethodFailedException: Method "setManager" failed for object com.zhym.action.ItemAddAction@3e2a
- ognl.MethodFailedException: Method "
- struts2异常ognl.MethodFailedException: Method "setId" failed for object
- 13:52:43,788 WARN OgnlValueStack:49-Error setting valueognl.MethodFailedException: Method "setAge" f
- 报错:HTTP Status 500 -Method "execute" failed for object……
- ognl.OgnlException: target is null for setProperty(null, "name", [Ljava.lang.String;@f6
- 【iOS开发】-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- ognl.OgnlException: target is null for setProperty(null, "XX", [Ljava.lang.String;@10f8ee4)解决
- Ios9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Error setting value Method "setAge" failed for object ..Ljava.lang.String 错误总结
- hibernate框架时遇到的错误ognl.MethodFailedException: Method "execute" f