File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes struts2 + jsp problem - ognl.MethodFailedException: Method 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 "struts2 + jsp problem - ognl.MethodFailedException: Method "setId" failed for object" Watch "struts2 + jsp problem - ognl.MethodFailedException: Method "setId" failed for object" New topic
Author

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

olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
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

Joined: Jun 20, 2009
Posts: 148
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

Joined: Jan 10, 2002
Posts: 60774
    
  65

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
olze oli
Ranch Hand

Joined: Jun 20, 2009
Posts: 148
sorry i've just overlook the "products"

Kev Adams
Greenhorn

Joined: Oct 27, 2009
Posts: 23
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:



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: struts2 + jsp problem - ognl.MethodFailedException: Method "setId" failed for object
 
Similar Threads
Retrieving request parameters (from the url) in a jsp page
passing parameter between pages in struts2 using hyperlink
Cache Problem
Type Conversion Problem
Interceptor messes up action class in Struts2