This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes type converson failed in struts 2 : ognl.MethodFailedException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "type converson failed in struts 2 : ognl.MethodFailedException" Watch "type converson failed in struts 2 : ognl.MethodFailedException" New topic
Author

type converson failed in struts 2 : ognl.MethodFailedException

vikas byn
Ranch Hand

Joined: Mar 18, 2011
Posts: 80
in my Test.class ,field1 is Double type.

in html code, <input type="text" name="field1" value="0.0"/>

when i submit form it will throw this exception if value of field1 is 0 or 0.0 -
WARNING: Error setting value
ognl.MethodFailedException: Method "setField1" failed for object net.one97.action.Test@16b98c3 [java.lang.NoSuchMethodException: setField1([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)

---

I tried many tricks but problem will not solve.
1)
create log4j.properties and put only two lines
log4j.logger.com.opensymphony.xwork2.util.OgnlUtil=error
log4j.logger.com.opensymphony.xwork2.ognl.OgnlValueStack=error

if there is need to configure log4j then let me know.

2) create struts.properties
and put a line -
struts.devMode=false

3)in struts.xml
<struts>
<constant name="struts.devMode" value="false" />
<package ...
...
</package>
</struts>


Nitin Surana
Ranch Hand

Joined: Jan 21, 2011
Posts: 129

vikas byn wrote:
WARNING: Error setting value
ognl.MethodFailedException: Method "setField1" failed for object net.one97.action.Test@16b98c3 [java.lang.NoSuchMethodException: setOtherRate([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)


It says the setter method doesn't exist of some other variable otherRate, solve that out first.
vikas byn
Ranch Hand

Joined: Mar 18, 2011
Posts: 80
Nitin Surana wrote:
vikas byn wrote:
WARNING: Error setting value
ognl.MethodFailedException: Method "setField1" failed for object net.one97.action.Test@16b98c3 [java.lang.NoSuchMethodException: setOtherRate([Ljava.lang.String;)]
at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823)


It says the setter method doesn't exist of some other variable otherRate, solve that out first.


Oh, it's my mistake.. I corrected typo mitsake. but problem was not solved. usually when i post any thread i changed class name and method name.

vikas byn
Ranch Hand

Joined: Mar 18, 2011
Posts: 80
how can i delete this post?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: type converson failed in struts 2 : ognl.MethodFailedException
 
Similar Threads
Facing an issue trying to use Struts 2.0.14 with Tiles 2.0.
struts2 + jsp problem - ognl.MethodFailedException: Method "setId" failed for object
newbie, execute method not working
Always getting error- no result defined for action and result success
Struts2 CannotRenderException