openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Das, Aditi" <Aditi....@schwab.com>
Subject PCEnhancer
Date Thu, 16 Aug 2007 03:20:25 GMT
Hi,
I noticed a peculiar behavior today, thought of sharing it with all. I
am trying to find a product corresponding to a id as below,
Product prod = (Product)em.find(Product.class,new Long(10));
 
And in persistence.xml, I have commented out Product
entity.<!--<class>entity.Product</class>-->
I am running with the latest jar where the javaagent is made optional.
 
If I run the application with the javaagent, everything works fine.
Without javaagent, I get the following error.
========================================================================
======
Exception in thread "main" <openjpa-1.0.0-SNAPSHOT-r420667:566021 fatal
user error> org.apache.openjpa.persistence.ArgumentException: The type
"class entity.Product" has not been enhanced.

at
org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:163
5)

at
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1607)

at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataReposit
ory.java:675)

at
org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepositor
y.java:575)

at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.ja
va:500)

at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepositor
y.java:302)

at
org.apache.openjpa.kernel.BrokerImpl.newObjectId(BrokerImpl.java:1094)

at
org.apache.openjpa.kernel.DelegatingBroker.newObjectId(DelegatingBroker.
java:257)

at
org.apache.openjpa.persistence.EntityManagerImpl.find(EntityManagerImpl.
java:348)

at sample.Test1.main(Test1.java:23)

========================================================================
===

The moment I provide the  persistence class name in persistence.xml,
everything works fine.
I was under the impression even if I don't provide the persistence class
name in persistence.xml, the system should search in classpath and load
it.
 
Is this a bug or this is a feature which will work only with Enhancer?
 
Please let me know.
 
 
Regards,
Aditi
I am not the best, but certainly not like the rest.
 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message