openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpalache <ravi.palache...@oracle.com>
Subject Re: NullPointerException in pcReplaceField
Date Wed, 27 May 2009 17:55:15 GMT

Hi Mike,

I am able to replicate the nullpointer exception with openJPA

Exception in thread "Thread-1" java.lang.NullPointerException
        at
org.apache.openjpa.kernel.StateManagerImpl.replaceObjectField(StateManagerImpl.java:2090)

        at Book.pcReplaceField(Book.java)
        at
org.apache.openjpa.kernel.StateManagerImpl.replaceField(StateManagerImpl.java:3056)
        at
org.apache.openjpa.kernel.StateManagerImpl.clearFields(StateManagerImpl.java:2665)
        at
org.apache.openjpa.kernel.PNonTransState.beforeWrite(PNonTransState.java:107)
        at
org.apache.openjpa.kernel.PNonTransState.beforeWrite(PNonTransState.java:77)
        at
org.apache.openjpa.kernel.StateManagerImpl.dirty(StateManagerImpl.java:1608)
        at
org.apache.openjpa.kernel.StateManagerImpl.settingStringField(StateManagerImpl.java:1976)

        at Book.pcSettitle(Book.java)
        at Book.setTitle(Book.java:23)
        at Main$2.run(Main.java:60)
        at java.lang.Thread.run(Thread.java:595)

You can download the test case from:
http://n2.nabble.com/file/n2982705/embeddopenJPA.zip embeddopenJPA.zip 

If you verify I set the property "<property name="openjpa.Multithreaded"
value="false"/>" even though I am spawning threads in my sample.

When I correct this configuration by changing MultiThreaded property to
"true" then my test case hangs.

Please let me know if you need more information.

Udi,
Please validate my test case to see if it is in sync with your application.

- Ravi.



Udi wrote:
> 
> Hey,
> I don't know yet how to force this situation, but it happens a lot:
> I get a NullPointerException caused by pcReplaceField.
> I can't paste the stack but it goes something like:
> ...
> caused bu: java.lang.NullPointerException
>         at MyProjrct.entities.Tree.pcReplaceField(Tree)
> and here some statemanager calls.
> 
> I'm pretty sure that the exception is not caused because of a detached
> entity..
> Is there any known issue for that? What can cause this exception?
> 
> thanks,
> Udi
> 

-- 
View this message in context: http://n2.nabble.com/NullPointerException-in-pcReplaceField-tp2979657p2982705.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message