glassfish
  1. glassfish
  2. GLASSFISH-20233

getSingleResult Fails: java.lang.CloneNotSupportedException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Works as designed
    • Affects Version/s: 4.0_b83
    • Fix Version/s: 4.0_b85
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Windows 7

      Description

      A fairly simple JPA query that was working on b76 is now failing. Below is the error I get. The code that generates the error is here: http://java.net/projects/cargotracker/downloads. It can be build via Maven and deployed. The error will occur on deployment. Is this a known problem? Please advise.

      Target Invocation Exception: java.lang.CloneNotSupportedException: java.util.Arrays$ArrayList
      at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:851)
      at org.eclipse.persistence.internal.jpa.QueryImpl.performPreQueryFlush(QueryImpl.java:962)
      at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:207)
      at org.eclipse.persistence.internal.jpa.QueryImpl.getSingleResult(QueryImpl.java:516)
      at org.eclipse.persistence.internal.jpa.EJBQueryImpl.getSingleResult(EJBQueryImpl.java:400)
      at net.java.cargotracker.infrastructure.persistence.jpa.JpaCargoRepository.find(JpaCargoRepository.java:23)
      at net.java.cargotracker.domain.model.handling.HandlingEventFactory.findCargo(HandlingEventFactory.java:60)
      at net.java.cargotracker.domain.model.handling.HandlingEventFactory.createHandlingEvent(HandlingEventFactory.java:44)
      at net.java.cargotracker.application.util.SampleDataGenerator.loadSampleCargos(SampleDataGenerator.java:129)
      at net.java.cargotracker.application.util.SampleDataGenerator.loadSampleData(SampleDataGenerator.java:73)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at com.sun.ejb.containers.interceptors.BeanCallbackInterceptor.intercept(InterceptorManager.java:1035)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
      at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:205)
      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:986)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
      at com.sun.ejb.containers.interceptors.CallbackInvocationContext.proceed(CallbackInvocationContext.java:205)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
      at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.init(SystemInterceptorProxy.java:125)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at com.sun.ejb.containers.interceptors.CallbackInterceptor.intercept(InterceptorManager.java:986)
      at com.sun.ejb.containers.interceptors.CallbackChainImpl.invokeNext(CallbackChainImpl.java:72)
      at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:412)
      at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:375)
      at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:1949)
      at com.sun.ejb.containers.AbstractSingletonContainer.createSingletonEJB(AbstractSingletonContainer.java:460)
      ... 44 more
      Caused by: Exception [EclipseLink-6055] (Eclipse Persistence Services - 2.5.0.v20130321-85f6cb0): org.eclipse.persistence.exceptions.QueryException
      Exception Description: The method invocation of the method [protected native java.lang.Object java.lang.Object.clone() throws java.lang.CloneNotSupportedException] on the object [[Leg

      {id=33, voyage=Voyage 0100S, loadLocation=Hong Kong [CNHKG], unloadLocation=New York [USNYC], loadTime=Mon Mar 02 00:00:00 EST 2009, unloadTime=Thu Mar 05 00:00:00 EST 2009}

      , Leg

      {id=34, voyage=Voyage 0200T, loadLocation=New York [USNYC], unloadLocation=Dallas [USDAL], loadTime=Fri Mar 06 00:00:00 EST 2009, unloadTime=Sun Mar 08 00:00:00 EST 2009}

      , Leg

      {id=35, voyage=Voyage 0300A, loadLocation=Dallas [USDAL], unloadLocation=Helsinki [FIHEL], loadTime=Mon Mar 09 00:00:00 EDT 2009, unloadTime=Thu Mar 12 00:00:00 EDT 2009}

      ]], of class [class java.util.Arrays$ArrayList], triggered an exception.
      Internal Exception: java.lang.reflect.InvocationTargetException
      Target Invocation Exception: java.lang.CloneNotSupportedException: java.util.Arrays$ArrayList
      at org.eclipse.persistence.exceptions.QueryException.methodInvocationFailed(QueryException.java:838)
      at org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.invokeCloneMethodOn(InterfaceContainerPolicy.java:245)
      at org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.cloneFor(InterfaceContainerPolicy.java:98)
      at org.eclipse.persistence.mappings.CollectionMapping.buildBackupCloneForPartObject(CollectionMapping.java:186)
      at org.eclipse.persistence.internal.indirection.IndirectionPolicy.backupCloneAttribute(IndirectionPolicy.java:74)
      at org.eclipse.persistence.internal.indirection.TransparentIndirectionPolicy.backupCloneAttribute(TransparentIndirectionPolicy.java:76)
      at org.eclipse.persistence.mappings.ForeignReferenceMapping.buildBackupClone(ForeignReferenceMapping.java:285)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildBackupClone(ObjectBuilder.java:502)
      at org.eclipse.persistence.mappings.AggregateMapping.buildBackupClonePart(AggregateMapping.java:125)
      at org.eclipse.persistence.mappings.AggregateMapping.buildBackupClone(AggregateMapping.java:114)
      at org.eclipse.persistence.internal.descriptors.ObjectBuilder.buildBackupClone(ObjectBuilder.java:502)
      at org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy.buildBackupClone(DeferredChangeDetectionPolicy.java:225)
      at org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy.revertChanges(DeferredChangeDetectionPolicy.java:289)
      at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.resumeUnitOfWork(UnitOfWorkImpl.java:5275)
      at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.writeChanges(RepeatableWriteUnitOfWork.java:470)
      at org.eclipse.persistence.internal.jpa.EntityManagerImpl.flush(EntityManagerImpl.java:846)
      ... 80 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:601)
      at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.invokeMethod(PrivilegedAccessHelper.java:409)
      at org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.invokeCloneMethodOn(InterfaceContainerPolicy.java:240)
      ... 94 more
      Caused by: java.lang.CloneNotSupportedException: java.util.Arrays$ArrayList
      at java.lang.Object.clone(Native Method)
      ... 100 more

        Issue Links

          Activity

            People

            • Assignee:
              Mitesh Meswani
              Reporter:
              reza_rahman
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: