• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
olze oli
Ranch Hand
Posts: 149
  • 0
  • Mark post as helpful
  • send pies
  • 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: 149
  • 0
  • Mark post as helpful
  • send pies
  • 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?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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: 149
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry i've just overlook the "products"

 
Kev Adams
Greenhorn
Posts: 23
  • 0
  • Mark post as helpful
  • send pies
  • 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:



 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic