Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.8.1
    • Fix Version/s: 2.3.7
    • Component/s: Core Actions
    • Labels:
      None
    • Environment:

      Windows XP

    • Flags:
      Important

      Description

      If action has a property of type ArrayList then an XWorkList object is created.
      This is not serializable so we get NotSerializableException when we try to send this List to the business tier.

      The problem that I can see is that a new field of type XWorkConverter has been added to the XWorkList in struts version 2.1.x This field is not Serializable.

        Activity

        Hide
        Hudson added a comment -

        Integrated in Struts2 #509 (See https://builds.apache.org/job/Struts2/509/)
        WW-3414 removes ObjectFactory as a field and uses ActionContext to retrieve instance of ObjectFactory to allow serialize instances of XWorkList (Revision 1364910)

        Result = SUCCESS
        lukaszlenart :
        Files :

        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java
        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/XWorkList.java
        • /struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/XWorkListTest.java
        Show
        Hudson added a comment - Integrated in Struts2 #509 (See https://builds.apache.org/job/Struts2/509/ ) WW-3414 removes ObjectFactory as a field and uses ActionContext to retrieve instance of ObjectFactory to allow serialize instances of XWorkList (Revision 1364910) Result = SUCCESS lukaszlenart : Files : /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/CollectionConverter.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/XWorkList.java /struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/XWorkListTest.java
        Hide
        Lukasz Lenart added a comment -

        Removed ObjectFactory as a field and now ObjectFactory is retrieved from ActionContext, please test the latest snapshot.

        Show
        Lukasz Lenart added a comment - Removed ObjectFactory as a field and now ObjectFactory is retrieved from ActionContext, please test the latest snapshot.
        Hide
        David added a comment -

        I encountered this issue on both Xwork/Struts 2.3.3 and Xwork/Struts 2.3.4 when trying to serialize an object containing an XWorkList. The stack trace that I receive says:

        java.io.NotSerializableException: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector

        When I downgrade my app to Xwork/Struts 2.3.1.2, I get the following error (for the same code - no changes other than the Struts & Xwork jars):

        java.io.NotSerializableException: com.opensymphony.xwork2.conversion.impl.XWorkConverter

        Could someone verify that XWorkList was actually made serializable in 2.3.3? Thanks.

        Show
        David added a comment - I encountered this issue on both Xwork/Struts 2.3.3 and Xwork/Struts 2.3.4 when trying to serialize an object containing an XWorkList. The stack trace that I receive says: java.io.NotSerializableException: com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector When I downgrade my app to Xwork/Struts 2.3.1.2, I get the following error (for the same code - no changes other than the Struts & Xwork jars): java.io.NotSerializableException: com.opensymphony.xwork2.conversion.impl.XWorkConverter Could someone verify that XWorkList was actually made serializable in 2.3.3? Thanks.
        Hide
        Lukasz Lenart added a comment -

        Or apply patch by yourself, build and used with your application, but anyway prepare for migration.

        Show
        Lukasz Lenart added a comment - Or apply patch by yourself, build and used with your application, but anyway prepare for migration.
        Hide
        Lukasz Lenart added a comment -

        Rather no, please upgrade to the latest available version, few security vulnerabilities were solved in mean time.

        Show
        Lukasz Lenart added a comment - Rather no, please upgrade to the latest available version, few security vulnerabilities were solved in mean time.
        Hide
        Rajeev kumar added a comment -

        Can we implement these changes on struts 2.2.1 tag to fix this issue?

        Show
        Rajeev kumar added a comment - Can we implement these changes on struts 2.2.1 tag to fix this issue?
        Hide
        Hudson added a comment -

        Integrated in Struts2 #393 (See https://builds.apache.org/job/Struts2/393/)
        WW-3414 add JavaDoc comments about new API
        WW-3414 removes not serializable field from XWorkList and uses Object Factory to obtain instance o XWorkBasicConverter

        lukaszlenart :
        Files :

        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java

        lukaszlenart :
        Files :

        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java
        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java
        • /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/XWorkList.java
        • /struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/XWorkListTest.java
        Show
        Hudson added a comment - Integrated in Struts2 #393 (See https://builds.apache.org/job/Struts2/393/ ) WW-3414 add JavaDoc comments about new API WW-3414 removes not serializable field from XWorkList and uses Object Factory to obtain instance o XWorkBasicConverter lukaszlenart : Files : /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java lukaszlenart : Files : /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/ObjectFactory.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/conversion/impl/XWorkBasicConverter.java /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/XWorkList.java /struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/XWorkListTest.java
        Hide
        Lukasz Lenart added a comment -

        Removed XWorkConverter from XWorkList and used Object Factory to obtain an instance of XWorkConverter instead

        Show
        Lukasz Lenart added a comment - Removed XWorkConverter from XWorkList and used Object Factory to obtain an instance of XWorkConverter instead

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            johan jarkovic
          • Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development