Uploaded image for project: 'JBoss Marshalling'
  1. JBoss Marshalling
  2. JBMAR-137

De-/Serializations fails on readResolve() and readObject()

XMLWordPrintable

    • Hide

      see description

      Show
      see description

      Precondition is a shared object between a client (war) and server (ejb/ear) and that its class is part of a non-shared library (eg. client.war/WEB-INF/lib/model.jar and server.ear/lib/model.jar).

      If the shared object implements the readResolve()-method, then the de-/serializations fails with a IllegalArgumentException (object is not an instance of declaring class). The reason for this is that the readResolve()-method is resolved at the class of the original object and is invoked on the cloned object. See SerializingCloner @223 and @260.

      If the shared object implements the readObject()-method like EnumMap, then the de-/serializations may fail with a ClassCastException (e.g. @ EnumMap.typeCheck()). The reason for this is, that the fields of the original object are not cloned before the readObject()-method is invocated. See SerializingCloner @302.

              dlloyd@redhat.com David Lloyd
              rzabel Ronny Zabel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: