[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Problem persisting Serializable type

I'm getting an exception in Eclipselink 2.0.1 (being used with Glassfish
3) when I try to persist an entity with a field of type Serializable.
I'm using Derby as the database.

The exception is as follows:

SEVERE: Error while saving process instance
javax.persistence.RollbackException:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:102)
        at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commit(EntityTransactionImpl.java:63)
        at
home.model.DataStoreManager.addDroolsProcessInstance(DataStoreManager.java:221)
        at
home.model.DataStoreManager.addNewProcessInstance(DataStoreManager.java:137)
        at
home.server.ConformaServiceImpl.addProcessInstance(ConformaServiceImpl.java:437)
        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.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
        at
org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at home.server.security.AuthFilter.doFilter(AuthFilter.java:151)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
        at
com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
        at
com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
        at
org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
        at
com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:239)
        at
com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
        at
com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
        at
com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
        at
com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
        at
com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
        at
com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
        at
com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
        at
com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
        at
com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
        at com.sun.grizzly.util.AbstractThreadPool
$Worker.doWork(AbstractThreadPool.java:330)
        at com.sun.grizzly.util.AbstractThreadPool
$Worker.run(AbstractThreadPool.java:309)
        at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at
org.eclipse.persistence.queries.DoesExistQuery.getDoesExistField(DoesExistQuery.java:245)
        at
org.eclipse.persistence.queries.DoesExistQuery.prepare(DoesExistQuery.java:306)
        at
org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:464)
        at
org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(DatabaseQuery.java:430)
        at
org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:646)
        at
org.eclipse.persistence.queries.DatabaseQuery.executeInUnitOfWork(DatabaseQuery.java:589)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2857)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1225)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1207)
        at
org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1167)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.checkForUnregisteredExistingObject(UnitOfWorkImpl.java:753)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4108)
        at
org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:801)
        at
org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:779)
        at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1533)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4120)
        at
org.eclipse.persistence.mappings.CollectionMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(CollectionMapping.java:358)
        at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1533)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4120)
        at
org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:801)
        at
org.eclipse.persistence.mappings.ObjectReferenceMapping.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectReferenceMapping.java:779)
        at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.cascadeDiscoverAndPersistUnregisteredNewObjects(ObjectBuilder.java:1533)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.discoverAndPersistUnregisteredNewObjects(UnitOfWorkImpl.java:4120)
        at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.discoverUnregisteredNewObjects(RepeatableWriteUnitOfWork.java:225)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.calculateChanges(UnitOfWorkImpl.java:691)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1493)
        at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:200)
        at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1129)
        at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
        ... 42 more

Here is the entity:

@Entity
public class Parameter {
    @Id
    private Long id;

    private Serializable parameterValue;

    public Serializable getParameterValue() {
        return parameterValue;
    }

    public void setParameterValue(Serializable parameterValue) {
        this.parameterValue = parameterValue;
    }   
}

The exception doesn't give me much of a clue of where the problem is.

But, if I leave parameterValue unset then persisting works just fine.
This was also working on Glassfish 2 using Toplink. So I'm wondering
what changed or what could I be doing wrong?

-- Rafael Bedia