• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

type converson failed in struts 2 : ognl.MethodFailedException

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>


 
Ranch Hand
Posts: 129
Netbeans IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how can i delete this post?
 
Don't destroy the earth! That's where I keep all my stuff! Including this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic