> o  The @ManagedInterface "instances" are created by the runtime when you
> call createInstance(c).  You should not be defining a separate @Entity
> class.  This is like doubly defining your object model.
> 
> 

Ok. I removed the @Entity from the class. So now in my persistence.xml,
instead of <class>EndpointObject</class>, I now have
<class>Endpoint</class>. Is this right?



> o  To that end, your @GeneratedValue should be moved from your Entity
> class
> to your ManagedInterface interface.
> 
> 
Ok. Done.



> o  And, it looks like you are doing a lot of extra processing with
> registration with the MetaDataRepository and ClassMetaData.  You should
> not
> have to mess around with these data structures.  After creating the
> instance
> and persisting it, the OpenJPA runtime should take care of the
> registration.
> 
> 

The reason I am doing the extra processing is because, if I don't, I get the
following error message. I found a solution to this in this forum at
http://n2.nabble.com/Problem-using-OpenJPAEntityManager-createInstance-td1493116.html

  [java] java.lang.IllegalArgumentException: No metadata was found for
managed interface Endpoint.
     [java]     at
org.apache.openjpa.kernel.BrokerImpl.newInstance(BrokerImpl.java:4319)
     [java]     at
org.apache.openjpa.kernel.DelegatingBroker.newInstance(DelegatingBroker.java:1392)
     [java]     at
org.apache.openjpa.persistence.EntityManagerImpl.createInstance(EntityManagerImpl.java:1243)
     [java]     at Main.main(Main.java:36)

So how else do I get rid of this error message?



> o  One additional thought is how are you performing the enhancement
> processing [2]?  To be honest, I'm not entirely clear on how the
> @ManagedInterface instance creation integrates with our enhancement
> processing.  Maybe another developer can shed some light on this aspect.
> 
> 

I am doing this by passing an arg to the jvm as follows in my build.xml
file.

<target name="Main">
                <java classname="Main" failonerror="true" fork="yes">
                        <jvmarg
value="-javaagent:/Users/gopi/packages/openjpa/openjpa-all-2.0.0-M3.jar" />
                        <classpath refid="TestJPA1.classpath" />
                </java>
</target>
-- 
View this message in context: 
http://n2.nabble.com/Problems-with-Interfaces-tp3894934p3895651.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to