Thanks for the testcase Ravi, I've copied your response verbatim into the
JIRA issue. If you wouldn't mind attaching the testcase to the JIRA that
might help as well. I'd do it but I don't want to make assumptions about
granting a license to the ASF on your behalf..


-mike

On Wed, May 27, 2009 at 12:55 PM, rpalache <[email protected]>wrote:

>
> 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.
>
>

Reply via email to