glassfish
  1. glassfish
  2. GLASSFISH-11883

StackOverflowError during EJB 2.1 method invocation while handling hashCode identical objects of a HashSet

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: V3
    • Fix Version/s: 3.1
    • Component/s: orb
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: All

    • Issuezilla Id:
      11,883

      Description

      While invoking a method of an EJB 2.1 from another EJB (2.1 or 3.0) out of
      container, java.lang.StackOverflowError will be thrown, if the 2.1 EJB returns
      a HashSet, which contains objects that have the same hashCode but differ in
      equals().

      Attached you can find the source files of a reproducer. Here we have EJB 2.1
      (CalledBean, defined in ejb-jar.xml and sun-ejb-jar.xml), EJB 3.0
      (SerializationBug, defined with annotations) and hashCode-identical class
      SameHashcodeObj. After compilation, the exception can be reproduced by simply
      deploying the ear.

      The problem seems to be, that the serialization mechanism leads to
      stackoverflow :

      Caused by: java.rmi.ServerError: Error occurred in server thread; nested
      exception is:
      java.lang.StackOverflowError
      at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.wrapException
      (Util.java:702)
      at
      com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke
      (StubInvocationHandlerImpl.java:246)
      at
      com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke
      (StubInvocationHandlerImpl.java:147)
      at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke
      (CodegenStubBase.java:225)
      at bug._Called_DynamicStub.getResult(bug/_Called_DynamicStub.java)
      at bug.SerializationBug.start(SerializationBug.java:16)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke
      (NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke
      (DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept
      (InterceptorManager.java:1006)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext
      (CallbackChainImpl.java:61)
      at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed
      (CallbackInvocationContext.java:109)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCallback
      (SystemInterceptorProxy.java:133)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init
      (SystemInterceptorProxy.java:115)
      ...
      Caused by: java.lang.StackOverflowError
      at sun.corba.Bridge.getInt(Bridge.java:203)
      at
      com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierOrdinaryImpl$ClassFieldCopie
      rUnsafeImpl$12.copy(ClassCopierOrdinaryImpl.java:655)
      at
      com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierOrdinaryImpl$ClassFieldCopie
      rUnsafeImpl.noDebugCopy(ClassCopierOrdinaryImpl.java:1011)
      at
      com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierOrdinaryImpl$ClassFieldCopie
      rUnsafeImpl.copy(ClassCopierOrdinaryImpl.java:1024)
      at
      com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierOrdinaryImpl.doCopy
      (ClassCopierOrdinaryImpl.java:1144)
      at com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierBase.copy
      (ClassCopierBase.java:122)
      at com.sun.corba.ee.impl.orbutil.copyobject.ClassCopierBase.copy
      (ClassCopierBase.java:112)
      ...

        Activity

        Hide
        sd_ added a comment -

        Created an attachment (id=4353)
        sample EAR with deployment configuration and source code

        Show
        sd_ added a comment - Created an attachment (id=4353) sample EAR with deployment configuration and source code
        Hide
        ksak added a comment -

        Reassigning to orb module.

        Show
        ksak added a comment - Reassigning to orb module.
        Hide
        rjdkolb added a comment -

        add cc

        Show
        rjdkolb added a comment - add cc
        Hide
        sd_ added a comment -

        For reproduction please remind to first compile the attached sources in
        SerializationBug.jar and to update the ear. The attached ear only contains the
        source files, so you will get a java.lang.ClassNotFoundException if direct
        deployed.

        Show
        sd_ added a comment - For reproduction please remind to first compile the attached sources in SerializationBug.jar and to update the ear. The attached ear only contains the source files, so you will get a java.lang.ClassNotFoundException if direct deployed.
        Hide
        Ken Cavanaugh added a comment -

        This work is being considered for 3.1 or a future release as part of issue 4083,
        so I am closing this and marking it as a duplicate of that issue.

            • This issue has been marked as a duplicate of 4083 ***
        Show
        Ken Cavanaugh added a comment - This work is being considered for 3.1 or a future release as part of issue 4083, so I am closing this and marking it as a duplicate of that issue. This issue has been marked as a duplicate of 4083 ***

          People

          • Assignee:
            Ken Cavanaugh
            Reporter:
            sd_
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: