Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] one-to-many: NullPointerException cause rollback

hi tom,
i'm using eclipselink 2.3.2.
BatchLoadWorldCheck.loadWCLists is a method that load data into a database.
I have a lot of classes generated from a xml schema using hyperjaxb3. I read data from a huge xml file and then I persist them.
These classes are related to each other. For example, a class Record has a one-to-many unidirectional mapping with a class RecordUpdatedItem and a class Person. These relationships are mapped by a column that acts like an index for the two tables.
everything goes well if I use Hibernate as JPA provider. I need another provider instead of Hibernate because loading takes too much time and I have to make it faster.
I tried with OpenJPA too, but it gave me a lot of troubles.
So I thought to use EclipseLink.
But during committing changes to the database I get that error and I don't know how to resolve it.

2012/4/13 Tom Ware <tom.ware@xxxxxxxxxx>
Hi Antonio,

 What version of EclipseLink are you using?

 Can you give me an idea of what is happening in: BatchLoadWorldCheck.loadWCLists?  What objects are involved?  How are they mapped?

-Tom


On 13/04/2012 9:02 AM, 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


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top