glassfish
  1. glassfish
  2. GLASSFISH-3515

NullPointerException when persisting OneToMany with MapKey

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.1peur1
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      3,515
    • Status Whiteboard:
      Hide

      HIGH

      Show
      HIGH

      Description

      I will work on coming up with a reproducible test case.

      I'm using v2 build 58. Not a or b, just build 58.

      I get a NullPointerException from the bowels of Toplink when I attempt to merge
      a detached entity that contains a @OneToMany association with a @MapKey whose
      key attribute is not the primary key of the associated entity. At least that's
      my best take on what's happening.

      Here is the stack (stand back):

      [#|2007-08-21T10:14:22.046-0400|INFO|sun-appserver9.1|javax.enterprise.system.container.ejb|_ThreadID=63;_ThreadName=p:
      thread-pool-1; w: 77;|
      javax.ejb.EJBException
      at
      com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3869)
      at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3769)
      at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3571)
      at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1354)
      at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1316)
      at
      com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:210)
      at
      com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:117)
      at $Proxy104.save(Unknown Source)
      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.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:154)
      at
      com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:687)
      at
      com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:227)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1846)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1706)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:1088)
      at
      com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:223)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:806)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.dispatch(CorbaMessageMediatorImpl.java:563)
      at
      com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.doWork(CorbaMessageMediatorImpl.java:2567)
      at
      com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:555)
      Caused by: java.lang.NullPointerException
      at java.util.Hashtable.put(Hashtable.java:399)
      at
      oracle.toplink.essentials.internal.queryframework.MapContainerPolicy.addInto(MapContainerPolicy.java:123)
      at
      oracle.toplink.essentials.internal.queryframework.ContainerPolicy.addInto(ContainerPolicy.java:107)
      at
      oracle.toplink.essentials.mappings.CollectionMapping.mergeIntoObject(CollectionMapping.java:788)
      at
      oracle.toplink.essentials.internal.descriptors.ObjectBuilder.mergeIntoObject(ObjectBuilder.java:2152)
      at
      oracle.toplink.essentials.internal.sessions.MergeManager.mergeChangesOfCloneIntoWorkingCopy(MergeManager.java:442)
      at
      oracle.toplink.essentials.internal.sessions.MergeManager.mergeChanges(MergeManager.java:264)
      at
      oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.mergeCloneWithReferences(UnitOfWorkImpl.java:2723)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.RepeatableWriteUnitOfWork.mergeCloneWithReferences(RepeatableWriteUnitOfWork.java:219)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerImpl.mergeInternal(EntityManagerImpl.java:235)
      at
      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl.merge(EntityManagerImpl.java:128)
      at
      com.sun.enterprise.util.EntityManagerWrapper.merge(EntityManagerWrapper.java:476)
      at myCode.ManagerBean.saveCore(ManagerBean.java:413)
      at myCode.ManagerBean.save(ManagerBean.java:380)
      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.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
      at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
      at
      com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2895)
      at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3986)
      at
      com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)
      ... 17 more

        Activity

        Hide
        gfbugbridge added a comment -

        <BT6595639>

        Show
        gfbugbridge added a comment - <BT6595639>
        Hide
        pkrogh added a comment -

        This will not be addressed as part of this release. Changing the milestone,
        and downgrading for now.

        Show
        pkrogh added a comment - This will not be addressed as part of this release. Changing the milestone, and downgrading for now.
        Hide
        guypelletier added a comment -

        Re-assigning to myself.

        Show
        guypelletier added a comment - Re-assigning to myself.
        Hide
        guypelletier added a comment -

        Starting ...

        Show
        guypelletier added a comment - Starting ...
        Hide
        guypelletier added a comment -

        I'm unable to reproduce this error. Can you post the code that is causing this
        problem? Or at least document the steps that lead to this error.

        Show
        guypelletier added a comment - I'm unable to reproduce this error. Can you post the code that is causing this problem? Or at least document the steps that lead to this error.
        Hide
        guypelletier added a comment -

        Only able to reproduce when a map key is incorrectly configured, that is, when
        it is possible to have a null key return. In a properly configured model this
        shouldn't happen and therefore no error.

        Show
        guypelletier added a comment - Only able to reproduce when a map key is incorrectly configured, that is, when it is possible to have a null key return. In a properly configured model this shouldn't happen and therefore no error.

          People

          • Assignee:
            guypelletier
            Reporter:
            ljnelson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: