openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: How to debug object retrieveal in JPA?
Date Tue, 01 May 2007 05:55:12 GMT
> Actually I am doing the clear, once I got rid of it the exception disappeared.
> SO IMHO no bug

Good to hear, but I think that we could still do some work to make
this easier to debug, at the least.

And I'm still concerned about how you could ever get a list of
exceptions back from a query execution.

-Patrick

On 4/30/07, Phill Moran <pjmoran@rogers.com> wrote:
> Actually I am doing the clear, once I got rid of it the exception disappeared.
> SO IMHO no bug
>
> Phill
>
> -----Original Message-----
> From: papajdo@gmail.com [mailto:papajdo@gmail.com] On Behalf Of Craig Russell
> Sent: April 30, 2007 5:08 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Re: How to debug object retrieveal in JPA?
>
> IMHO, this is a bug in the generated code for pcNewInstance.
>
> I don't understand why the pcNewInstance should ever call pcClearFields. It just
> got finished creating a new instance, and it knows that all fields have been set
> to their Java default values.
> [That's why we require the user to specify a no-args constructor, so the
> implementation doesn't have to initialize anything.] I don't think that calling
> pcClearFields is warranted during this life cycle phase.
>
> Craig
>
> Caused by: java.lang.NullPointerException
>         at java.util.ArrayList.addAll(ArrayList.java:472)
>         at ca.BidSpec.emall.user.Person.pcsetPhoneNumbers(Person.java:727)
>         at ca.BidSpec.emall.user.Person.pcClearFields(Person.java)
>         at ca.BidSpec.emall.user.Person.pcNewInstance(Person.java)
>         at
> org.apache.openjpa.enhance.PCRegistry.newInstance(PCRegistry.java:121)
>
>
> I had read this and assumed that it was an OpenJPA-generated method, but if so,
> there shouldn't be a line number. Did you reverse-compile your classes at some
> point and change the synthetic interception methods?
>
> That is the original method with a new name.  As the documentation states, the
> getters and setters used in property access may appear with a "pc" prefix in
> stack traces under OpenJPA.
>
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message