• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

struts2 + jsp problem - ognl.MethodFailedException: Method "setId" failed for object

 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

i'm using struts2, spring and hibernate3 for a liferay portlet
my struts.xml:

the portlet is called MontyBrogan and it is displayed correctly - i can see the submit form from listLectures.jsp:

but when i hit the button "Neue Lecture" i get the following error:

i have a getId method in my LectureAction.java:


i have no idea whats wrong - please help me
and why does it look for a getId(String) ??? shouldn't it be getId(long) or getId(int) ?
 
olze oli
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i found a site where someone has the same problem:
http://www.nabble.com/Struts-2.1.2-type-conversion-failing-for-Integer-method.-td20475044.html

And one "workaround" is:
"So the workaround for me was to stop using generic properties in my Model objects."
But i have no idea whats a generic propertie??

can please someone explain me what it does mean?
 
Sheriff
Posts: 67754
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.
 
olze oli
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sorry i've just overlook the "products"

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting this error too in Struts 2.1.8.

For me it happens when you *do not* enter a value in a field that maps to an integer in your action.

The jira, located at: https://issues.apache.org/struts/browse/WW-2971, says that it has been resolved, but still the problem remains. This particular incident mentions the conversion from a double, but it also is happening with an int.

Does anyone have any suggestions as to how to fix this?

I don't know if this will help, but here is a list of my jars:



 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic