openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patrick Linskey" <plins...@gmail.com>
Subject Re: PCEnhancer
Date Thu, 16 Aug 2007 13:35:24 GMT
Hi,

Currently, the enhancement-less behavior requires that you list your
persistent types in persistence.xml. We could integrate the behavior
with the class-scanning capabilities, but that hasn't been done yet.

-Patrick

On 8/15/07, Das, Aditi <Aditi.Das@schwab.com> wrote:
> 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.
>
>


-- 
Patrick Linskey
202 669 5907

Mime
View raw message