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

The problem is with a unidirectional 1:M, but it doesn't give an indication on why as all the objects involved should have been instantiated during deploy.

Can you give the exact code used to setup the mappings? You may need to narrow down the problem by minimizing the transaction that reproduces the issue as much as possible. It will also help to set EclipseLink logging to finest using <property name="eclipselink.logging.level" value="FINEST"/> in case there are warnings or other problems during setup that are being missed that might relate to this issue.

Best Regards,
Chris



On 13/04/2012 10:37 AM, Antonino Vitale wrote:
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 <mailto: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.__updateTargetRowPostInsertSourc__e(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 <mailto:eclipselink-users@xxxxxxxxxxx>
        https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
        <https://dev.eclipse.org/mailman/listinfo/eclipselink-users>

    _________________________________________________
    eclipselink-users mailing list
    eclipselink-users@xxxxxxxxxxx <mailto:eclipselink-users@xxxxxxxxxxx>
    https://dev.eclipse.org/__mailman/listinfo/eclipselink-__users
    <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