« Return to Thread: nullpointer exception cause rollback

Re: nullpointer exception cause rollback

by James Sutherland :: Rate this Message:

| View in Thread

My only guess from the stack is that you are trying to persist a non mapped subclass of a persistence class, or have some sort of class loader issue.

Please try to isolate the issue and include how you have mapped the class and what you are doing to get the error, and what environment and version you are using.  Try to determine when the error occurs and when it does not, and if it occurs with some objects, and not others.

I have not seen this error before.  Also try the latest release to see if it is something that has been fixed.

Antonino Vitale wrote:
Hi everybody,
I'm using Eclipselink as JPA provider for my application.
I have many classes generated from a xml schema using hyperjaxb3.
I have annotations for both jpa and xml elements.
my classes have one-to-many relationships, for example a class person has a
relationship with a class names and a class record has a relationship with
person etc...
the problem is that i get a nullpointerexception during committing changes
to database.
this is the stacktrace:

Exception in thread "main" javax.persistence.
RollbackException: java.lang.NullPointerException
    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 BatchLoadWorldCheck.loadWCLists(BatchLoadWorldCheck.java:428)
    at BatchLoadWorldCheck.main(BatchLoadWorldCheck.java:137)
Caused by: java.lang.NullPointerException
    at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.extractValueFromObjectForField(ObjectBuilder.java:2565)[EL
Warning]: 2012-04-12
14:58:45.918--UnitOfWork(18164750)--java.lang.NullPointerException

    at
org.eclipse.persistence.mappings.OneToManyMapping.updateTargetRowPostInsertSource(OneToManyMapping.java:1337)
    at
org.eclipse.persistence.mappings.OneToManyMapping.performDataModificationEvent(OneToManyMapping.java:900)
    at
org.eclipse.persistence.internal.sessions.CommitManager.commitAllObjectsWithChangeSet(CommitManager.java:157)
    at
org.eclipse.persistence.internal.sessions.AbstractSession.writeAllObjectsWithChangeSet(AbstractSession.java:3799)
    at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1415)
    at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:636)
    at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1505)
    at
org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitRootUnitOfWork(RepeatableWriteUnitOfWork.java:267)
    at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitAndResume(UnitOfWorkImpl.java:1143)
    at
org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.commitInternal(EntityTransactionImpl.java:84)
    ... 3 more

using hibernate as jpa provider all goes well. I thought to move to
eclipselink because of a huge number of load operations that in hibernate
make my application slower.
if you know the answer, please help me! I'm really confused about this
error and I'm new to this kind of things so I can not find solutions.
thank you very much.
bye

Nino

 « Return to Thread: nullpointer exception cause rollback