glassfish
  1. glassfish
  2. GLASSFISH-12599

Injected Session Bean not serializable when it should be

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1_ms07
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      12,599
    • Status Whiteboard:
      Hide

      weld-int-required

      Show
      weld-int-required

      Description

      I have a stateless session bean Foo (no-interface local view) which implements
      Serializable.

      When I inject this bean into a client class FooClient, in one of the following ways,

      @Inject
      private Foo foo;

      or

      @EJB
      private Foo foo;

      the injected member foo fails to serialize and deserialize correctly.

      I tested this using writeObject(foo) to a stream followed by readObject(...)
      from that stream.

      In the first case (@Inject), I get a null pointer exception when calling any
      method on the object returned by readObject().

      In the second case (@EJB), writeObject(foo) fails because
      com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate is not serializable.

      In the first case, the injected instance is a javaassist proxy wrapping a
      Glassfish proxy wrapping the Foo implementation. The javasssist proxy appears to
      be broken as reported in https://jira.jboss.org/browse/JASSIST-97.

      After patching the weld-osgi-bundle.jar with javassist-3.12.1.GA which fixes the
      bug, I ran into the same problem with EJBLocalObjectInvocationHandlerDelegate as
      in the second case.

      To sum up:
      1) Glassfish needs to ensure that any proxy it generates for a serializable EJB
      is also serializable.

      2) Weld needs to be upgraded to a newer version containing the Javassist bugfix.

        Activity

        Harald Wellmann created issue -
        kenaiadmin made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 12599 44203

          People

          • Assignee:
            Sivakumar Thyagarajan
            Reporter:
            Harald Wellmann
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: