Ognl. Methodfailedexception:method "Setxx" failed for object

Source: Internet
Author: User

Exceptions caused by mismatched data types

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)

You can debug by viewing ognl. SetValue () Source code lookup problem in the Ognl.java class

public static void SetValue (object tree, Map context, object root, Object value) throws Ognlexception {Ognlcontext OGNL Context = (Ognlcontext) adddefaultcontext (root, context); node n = (node) tree; N.setvalue (Ognlcontext, root, value); }//n is both the name attribute of the INPUT element in the JSP page form form, such as <input name= "User.username" value= "123"/> and then in OGNL through the action sett The ER method invokes ognl. The above method in Ognl.java: N ==> user.username value ==> 123

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.