openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phill Moran" <pjmo...@rogers.com>
Subject RE: How to debug object retrieveal in JPA?
Date Mon, 30 Apr 2007 22:18:09 GMT
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.


Mime
View raw message