Ok sorry, I figured this one out as well.
The problem was, my persistence.xml file had not included one of the
classes in a chain of @MappedSuperclass's connecting the real Entity
to the parent class containing PrePersist.

Now it works.

-Marc

On 10/31/07, Patrick Linskey <[EMAIL PROTECTED]> wrote:
> > Ok, I solved this one. This error results from having an entity class
> > which is not annotated with @Entity.
>
> Good to know. That should be easy to fix.
>
> > Now I am trying to get a @PrePersist method called from a
> > MappedSuperclass in its derived Entity. Are there any known bugs
> > preventing this from working?
>
> I don't remember the rules in the spec for lifecycle callback
> inheritance, sadly.
>
> -Patrick
>
> On Oct 31, 2007 8:36 AM, Marc Siegel <[EMAIL PROTECTED]> wrote:
> > Ok, I solved this one. This error results from having an entity class
> > which is not annotated with @Entity.
> >
> > Now I am trying to get a @PrePersist method called from a
> > MappedSuperclass in its derived Entity. Are there any known bugs
> > preventing this from working?
> >
> > -Marc
> >
> >
> > On 10/31/07, Marc Siegel <[EMAIL PROTECTED]> wrote:
> > > Hi Patrick,
> > >
> > > > The original source code contribution came from BEA, and BEA is
> > > > actively involved in OpenJPA (I'm a BEA employee, for example). There
> > > > are other folks employed by other organizations involved in the
> > > > project to varying degrees as well; I'll leave it to them to declare
> > > > themselves so that I don't forget anyone and feel bad about it.
> > > >
> > > > But if you're looking for somewhere to send some beer to or something,
> > > > I'm sure you won't get any objections, of course.
> > >
> > > Heh, any beer-sending will have to be after I succeed in getting this
> > > project to work!
> > >
> > > Can you shed any light on this stack trace by any chance?
> > >
> > > Thanks,
> > > -Marc
> > >
> > >
> > > Exception in thread "main" <openjpa-1.0.0-r420667:568756 fatal general
> > > error> org.apache.openjpa.persistence.PersistenceException: null
> > >         at 
> > > org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:303)
> > >         at 
> > > org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:197)
> > >         at 
> > > org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142)
> > >         at 
> > > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192)
> > >         at 
> > > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145)
> > >         at 
> > > org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56)
> > >         at com.leadgenllc.lib.Joe.initialize(Joe.java:70)
> > >         at com.leadgenllc.lib.Joe.<init>(Joe.java:30)
> > >         at com.leadgenllc.testapp.joe.JoeTestApp.main(JoeTestApp.java:12)
> > > Caused by: java.lang.NullPointerException
> > >         at 
> > > org.apache.openjpa.enhance.ManagedClassSubclasser.setDetachedState(ManagedClassSubclasser.java:275)
> > >         at 
> > > org.apache.openjpa.enhance.ManagedClassSubclasser.configureMetaData(ManagedClassSubclasser.java:213)
> > >         at 
> > > org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:137)
> > >         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > >         at 
> > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > >         at 
> > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >         at java.lang.reflect.Method.invoke(Method.java:585)
> > >         at 
> > > org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:287)
> > >         ... 8 more
> > >
> >
>
>
>
> --
> Patrick Linskey
> 202 669 5907
>

Reply via email to