Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » A NullPointerException was thrown while extracting a value from the instance variable [amount] in th
A NullPointerException was thrown while extracting a value from the instance variable [amount] in th [message #384218] Thu, 04 December 2008 13:44 Go to next message
Milos is currently offline MilosFriend
Messages: 12
Registered: July 2009
Junior Member
I get the following exception during commiting of transaction.

Exception Description: A NullPointerException was thrown while extracting a
value from the instance variable [amount] in the object [null].
Internal Exception: java.lang.NullPointerException
Mapping:
org.eclipse.persistence.mappings.DirectToFieldMapping[amount -- >UNIT.AMOUNT]
Descriptor: RelationalDescriptor(com.test.Amount --> [DatabaseTable(UNIT)])

AMOUNT in UNIT table is mapped using Embedded object.

Here is underlying stacka trace


Descriptor:
RelationalDescriptor(com.antegra.banking.directdebit.instruc tion.plain.Amount
--> [DatabaseTable(DD1CALCULAT
ION_UNIT)])
at
org.eclipse.persistence.exceptions.DescriptorException.nullP ointerWhileGettingValueThruInstanceVariableAccess
or(DescriptorException.java:1232)
at
org.eclipse.persistence.internal.descriptors.InstanceVariabl eAttributeAccessor.getAttributeValueFromObject(In
stanceVariableAttributeAccessor.java:87)
at
org.eclipse.persistence.mappings.DatabaseMapping.getAttribut eValueFromObject(DatabaseMapping.java:429)
at
org.eclipse.persistence.mappings.foundation.AbstractDirectMa pping.compareObjects(AbstractDirectMapping.java:2
86)
at
org.eclipse.persistence.mappings.foundation.AbstractDirectMa pping.compareForChange(AbstractDirectMapping.java
:255)
at
org.eclipse.persistence.descriptors.changetracking.Attribute ChangeTrackingPolicy.createObjectChangeSet(Attrib
uteChangeTrackingPolicy.java:73)
at
org.eclipse.persistence.descriptors.changetracking.DeferredC hangeDetectionPolicy.calculateChanges(DeferredCha
ngeDetectionPolicy.java:80)
at
org.eclipse.persistence.internal.descriptors.ObjectBuilder.c ompareForChange(ObjectBuilder.java:1531)
at
org.eclipse.persistence.mappings.AggregateMapping.compareFor Change(AggregateMapping.java:297)
at
org.eclipse.persistence.descriptors.changetracking.Attribute ChangeTrackingPolicy.createObjectChangeSet(Attrib
uteChangeTrackingPolicy.java:73)
at
org.eclipse.persistence.descriptors.changetracking.DeferredC hangeDetectionPolicy.calculateChanges(DeferredCha
ngeDetectionPolicy.java:80)
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.cal culateChanges(UnitOfWorkImpl.java:557)
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.com mitToDatabaseWithChangeSet(UnitOfWorkImpl.java:13
20)
at
org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.iss ueSQLbeforeCompletion(UnitOfWorkImpl.java:2848)
at
org.eclipse.persistence.internal.sessions.RepeatableWriteUni tOfWork.issueSQLbeforeCompletion(RepeatableWriteU
nitOfWork.java:223)
at
org.eclipse.persistence.transaction.AbstractSynchronizationL istener.beforeCompletion(AbstractSynchronizationL
istener.java:157)
at
org.eclipse.persistence.transaction.JTASynchronizationListen er.beforeCompletion(JTASynchronizationListener.ja
va:68)
at
weblogic.transaction.internal.ServerSCInfo.doBeforeCompletio n(ServerSCInfo.java:1217)
at
weblogic.transaction.internal.ServerSCInfo.callBeforeComplet ions(ServerSCInfo.java:1195)
at
weblogic.transaction.internal.ServerSCInfo.startPrePrepareAn dChain(ServerSCInfo.java:118)
at
weblogic.transaction.internal.ServerTransactionImpl.localPre PrepareAndChain(ServerTransactionImpl.java:1302)
at
weblogic.transaction.internal.ServerTransactionImpl.globalPr ePrepare(ServerTransactionImpl.java:2114)
at
weblogic.transaction.internal.ServerTransactionImpl.internal Commit(ServerTransactionImpl.java:263)
... 37 more
Caused by: java.lang.NullPointerException
at
sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAcc essorImpl.java:36)
at
sun.reflect.UnsafeObjectFieldAccessorImpl.get(UnsafeObjectFi eldAccessorImpl.java:18)
at java.lang.reflect.Field.get(Field.java:358)
at
org.eclipse.persistence.internal.descriptors.InstanceVariabl eAttributeAccessor.getAttributeValueFromObject(In
stanceVariableAttributeAccessor.java:75)
... 58 more


Google wasn't of much help. I found a post on OTN forum regarding the same
problem, and it looks like there was same problem on TopLink 10.3. As for
official explanations, I found only:

ECLIPSELINK-00069: A NullPointerException was thrown while extracting a
value from the instance variable [{0}] in the object [{1}].
Cause: An object is accessed to get the value of an instance variable
through Java reflection. This exception is raised only on some JVMs.
Action: Inspect the internal exception, and refer to the Java
documentation.
Not very helpful.

I could use some info on this, because it is quite critical.

Thanks,
Milos
Re: A NullPointerException was thrown while extracting a value from the instance variable [amount] i [message #384223 is a reply to message #384218] Thu, 04 December 2008 14:23 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The error is somehow related to your aggregate (embeddable) usage. What
exactly are you doing to get the error?

Are you sharing the same embeddable object from two different parent
objects? Is your embeddable null, or have inheritance?

If you can create a simplified test case, please log a bug.

---
James
http://www.nabble.com/EclipseLink---Users-f26658.html


James : Wiki : Book : Blog : Twitter
Re: A NullPointerException was thrown while extracting a value from the instance variable [amount] i [message #384226 is a reply to message #384223] Thu, 04 December 2008 14:55 Go to previous message
Milos is currently offline MilosFriend
Messages: 12
Registered: July 2009
Junior Member
It happens when I try to commit (I have bean managed transaction). Object is
read, then changed and updated.

"James " <james.sutherland@oracle.com> wrote in message
news:a537e681400b5d925b5fc885c525bbc4$1@www.eclipse.org...
> The error is somehow related to your aggregate (embeddable) usage. What
> exactly are you doing to get the error?
>
> Are you sharing the same embeddable object from two different parent
> objects? Is your embeddable null, or have inheritance?
>
> If you can create a simplified test case, please log a bug.
>
> ---
> James
> http://www.nabble.com/EclipseLink---Users-f26658.html
>
Previous Topic:unusual exceptionrelating relational descriptor
Next Topic:Yikes! ConcurrentModificationException
Goto Forum:
  


Current Time: Thu Apr 25 05:19:06 GMT 2024

Powered by FUDForum. Page generated in 0.03104 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top