Hi, The classes with the underscore (_) at the end are the generated metamodel classes [1]. With Java SE 6 and OpenJPA 2.x, these metamodel classes should be automatically created and compiled for you when you compile your entities. It could be that you are not packaging these extra class files into your jar files and, thus, can not be found when you attempt to do the getMetamodel() invocation.
Kevin [1] http://openjpa.apache.org/builds/latest/docs/manual/manual.html#d0e11101 On Fri, Jan 28, 2011 at 7:36 AM, Christopher Schmidt < [email protected]> wrote: > The property is already in both PUs and em.getMetamodel.getEntities does > return the right Set of EntityTypes without the "_" > > Christopher > > On Thu, Jan 27, 2011 at 2:28 PM, Mark Struberg <[email protected]> wrote: > > > I guess thats the proxy you get. This will get generated for you if the > > compiletime enhancement didn't work out. > > > > Maybe you have an error in the openjpa-maven-plugin configuration? > > > > Can you please try to add the following to your persistence.xml (both > PUs): > > > > <!-- disable runtime instrumentation --> > > <property name="openjpa.DynamicEnhancementAgent" > value="false"/> > > > > LieGrue, > > strub > > > > --- On Thu, 1/27/11, Christopher Schmidt <[email protected]> > wrote: > > > > > From: Christopher Schmidt <[email protected]> > > > Subject: Re: em.getMetamodel exceptions > > > To: [email protected] > > > Date: Thursday, January 27, 2011, 1:24 PM > > > Nothing special. It's a Unit test > > > with Maven. > > > > > > Enhancement with the openjpa-maven-plugin class > > > enhancement. > > > > > > The question is: Who is adding this "_" to the class > > > names? > > > > > > Christopher > > > > > > On Thu, Jan 27, 2011 at 2:19 PM, Mark Struberg <[email protected]> > > > wrote: > > > > > > > are you using runtime enhancement with a proxy? > > > > > > > > Which appserver, what environment, SecurityManager in > > > place, etc? > > > > > > > > LieGrue, > > > > strub > > > > > > > > --- On Thu, 1/27/11, Christopher Schmidt <[email protected]> > > > wrote: > > > > > > > > > From: Christopher Schmidt <[email protected]> > > > > > Subject: Re: em.getMetamodel exceptions > > > > > To: [email protected] > > > > > Date: Thursday, January 27, 2011, 1:16 PM > > > > > The class XXX.persistence.popo.Road_ > > > > > does not exist... > > > > > XXX.persistence.popo.Road does exist and works > > > fine. > > > > > > > > > > Forgot to say that I use two persistence Units > > > and > > > > > therefore two > > > > > EntityManagerFactories. > > > > > > > > > > Christopher > > > > > > > > > > On Thu, Jan 27, 2011 at 2:08 PM, Mark Struberg > > > <[email protected]> > > > > > wrote: > > > > > > > > > > > can you try a class.forName on this class? > > > > > > > > > > > > First guess is that you have no access to > > > class. > > > > > Either the jar is not on > > > > > > the classfile, or it is not public... > > > > > > Or a subsequent dependency is missing. > > > > > > > > > > > > LieGrue, > > > > > > strub > > > > > > > > > > > > --- On Thu, 1/27/11, Christopher Schmidt > > > <[email protected]> > > > > > wrote: > > > > > > > > > > > > > From: Christopher Schmidt <[email protected]> > > > > > > > Subject: em.getMetamodel exceptions > > > > > > > To: [email protected] > > > > > > > Date: Thursday, January 27, 2011, 12:54 > > > PM > > > > > > > Hi, while calling em.getMetamodel > > > > > > > where em is the current EntityManager > > > I > > > > > > > get the following INFO trace of all > > > entities: > > > > > > > > > > > > > > Running XXX.persistence.popo.MyTest > > > > > > > 131 XXX > > > INFO [main] > > > > > > > openjpa.Runtime - OpenJPA dynamically > > > loaded a > > > > > > > validation provider. > > > > > > > 168 XXX > > > INFO [main] > > > > > > > openjpa.Runtime - Starting OpenJPA > > > 2.0.1 > > > > > > > 361 XXX > > > INFO [main] > > > > > > > openjpa.jdbc.JDBC - Using dictionary > > > class > > > > > > > > > > > > > > > "org.apache.openjpa.jdbc.sql.PostgresDictionary". > > > > > > > 1151 XXX > > > > > WARN [main] > > > > > > > openjpa.MetaData - Meta class > > > > > > > "XXX.persistence.popo.Road_" for entity > > > class > > > > > > > XXX.persistence.popo.Road can > > > > > > > not be registered with following > > > exception > > > > > > > > > > "java.security.PrivilegedActionException: > > > > > > > java.lang.ClassNotFoundException: > > > > > > > XXX.persistence.popo.Road_" > > > > > > > 1155 XXX > > > > > WARN [main] > > > > > > > openjpa.MetaData - Meta class > > > > > > > "XXX.persistence.popo.Location_" for > > > entity > > > > > > > class XXX.persistence.popo.Location can > > > not be > > > > > registered > > > > > > > with following > > > > > > > exception > > > > > "java.security.PrivilegedActionException: > > > > > > > java.lang.ClassNotFoundException: > > > > > > > XXX.persistence.popo.Location_" > > > > > > > . . . > > > > > > > > > > > > > > Any advice what can be the cause for > > > this? > > > > > > > > > > > > > > -- > > > > > > > Christopher > > > > > > > twitter: @fakod > > > > > > > blog: http://blog.fakod.eu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Christopher > > > > > twitter: @fakod > > > > > blog: http://blog.fakod.eu > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Christopher > > > twitter: @fakod > > > blog: http://blog.fakod.eu > > > > > > > > > > > > > > -- > Christopher > twitter: @fakod > blog: http://blog.fakod.eu >
