struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Matthews-Grout (JIRA)" <>
Subject [jira] [Created] (WW-3822) Struts 2 and Generic Class - Null Pointer Exception
Date Sat, 19 May 2012 22:33:40 GMT
Daniel Matthews-Grout created WW-3822:

             Summary: Struts 2 and Generic Class - Null Pointer Exception
                 Key: WW-3822
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions:
         Environment: Windows 7 - Java 6 - Tomcat 7
            Reporter: Daniel Matthews-Grout
            Priority: Minor

I have a class that extends a generic abstract class and types that generic - e.g.

class MyClass extends AbstractClass<Integer> ..

class AbstractClass<ID extends Serializable> {
   public abstract ID getId();

<s:property value=""/>

The abstract class defined an abstract getter that I implemented in the concrete class.  I
then referenced this getter in the JSP of a Struts 2 action and got the following:

 at com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer.getClass(
 at com.opensymphony.xwork2.conversion.impl.DefaultObjectTypeDeterminer.getKeyClass(
 at com.opensymphony.xwork2.ognl.accessor.XWorkMapPropertyAccessor.getProperty(
 at ognl.OgnlRuntime.getProperty(
 at ognl.ASTProperty.getValueBody(
 at ognl.SimpleNode.evaluateGetValueBody(
 at ognl.SimpleNode.getValue(
 at ognl.ASTChain.getValueBody(
 at ognl.SimpleNode.evaluateGetValueBody(
 at ognl.SimpleNode.getValue(
 at ognl.Ognl.getValue(
 at ognl.Ognl.getValue(

So what I had to do was to add a another get/set pair in the concrete class that updated/read
from the same field.  This stopped the error.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message