openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell" <craig.russ...@sun.com>
Subject Re: How to debug object retrieveal in JPA?
Date Mon, 30 Apr 2007 21:08:23 GMT
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