Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-15263

[GSS](7.1.z) Default constructor of non-Serializable parent POJO is not called in deserialization process

XMLWordPrintable

    • Hide

      Reproducer project is an EAR, containing an EJB and a Servlet as EJB client.

      To rebuild: under "simple-ejb-ear" directory, do "mvn clean package"

      To test:
      1) Start up an out-of-box (all default setting) EAP 7.0.9 or 7.1.4, add admin user
      2) In EAP web management console (http://localhost:9990), select "simple-ejb-ear/simple-ejb-ear-ear/target/simple-ejb-ear-ear.ear" to deploy
      3) Open a browser and hit "http://localhost:8080/simple-ejb-ear-web/"

      I put 3 similar fields in CacheableObject.java for testing, the default constructor of the POJO initializes them as below:
      -------------------------------------------------------------------
      public CacheableObject()

      { this._mutable_one = true; this._mutable_two = false; this._mutable_three = true; }

      -------------------------------------------------------------------
      On client side: I create this object and set "_mutable_three" to false manually, so I sent "true, false, false" into EJB call.
      On server side: I print these values on receiving the call.

      On EAP 7.0.9:
      Client send: "true, false, false"
      Server received: "true, false, true"
      Conclusion-1: default constructor of CacheableObject class is called on both EJB client and EJB server side - correct behavior
      Conclusion-2: the value of transient field "_mutable_three" is not kept through the EJB call - correct behavior

      On EAP 7.1.4:
      Client send: "true, false, false"
      Server received: "false, false, false"
      Conclusion: default constructor of CacheableObject class is called on EJB client side, BUT NOT called on EJB server side - incorrect behavior

      Show
      Reproducer project is an EAR, containing an EJB and a Servlet as EJB client. To rebuild: under "simple-ejb-ear" directory, do "mvn clean package" To test: 1) Start up an out-of-box (all default setting) EAP 7.0.9 or 7.1.4, add admin user 2) In EAP web management console ( http://localhost:9990 ), select "simple-ejb-ear/simple-ejb-ear-ear/target/simple-ejb-ear-ear.ear" to deploy 3) Open a browser and hit "http://localhost:8080/simple-ejb-ear-web/" I put 3 similar fields in CacheableObject.java for testing, the default constructor of the POJO initializes them as below: ------------------------------------------------------------------- public CacheableObject() { this._mutable_one = true; this._mutable_two = false; this._mutable_three = true; } ------------------------------------------------------------------- On client side: I create this object and set "_mutable_three" to false manually, so I sent "true, false, false" into EJB call. On server side: I print these values on receiving the call. On EAP 7.0.9: Client send: "true, false, false" Server received: "true, false, true" Conclusion-1: default constructor of CacheableObject class is called on both EJB client and EJB server side - correct behavior Conclusion-2: the value of transient field "_mutable_three" is not kept through the EJB call - correct behavior On EAP 7.1.4: Client send: "true, false, false" Server received: "false, false, false" Conclusion: default constructor of CacheableObject class is called on EJB client side, BUT NOT called on EJB server side - incorrect behavior

      This is reported by customer support case 02163009.
      I'm not sure if "EJB" is correct component but since customer observed this issue in their EJB applications (and reproducer is made based on EJB project), I'm selecting "EJB" as this component, please help to correct it if not EJB.

      The issue: When deserializing an object, the very first step is calling the default constructor of the first non-Serializable parent. However, in an EJB call on EAP 7.1, we observed this parent constructor is not called.

              dlloyd@redhat.com David Lloyd
              rhn-support-lywang Lyle Wang (Inactive)
              Daniel Cihak Daniel Cihak
              Daniel Cihak Daniel Cihak
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: