Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 108 invoked from network); 16 Aug 2007 13:35:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Aug 2007 13:35:53 -0000 Received: (qmail 85170 invoked by uid 500); 16 Aug 2007 13:35:50 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 84992 invoked by uid 500); 16 Aug 2007 13:35:50 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 84983 invoked by uid 99); 16 Aug 2007 13:35:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 06:35:50 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of plinskey@gmail.com designates 209.85.132.248 as permitted sender) Received: from [209.85.132.248] (HELO an-out-0708.google.com) (209.85.132.248) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 13:35:46 +0000 Received: by an-out-0708.google.com with SMTP id c24so157525ana for ; Thu, 16 Aug 2007 06:35:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QE9UkNihDn2tDJfPD59qoNtvgR7y9Xbk58yL/qd46n9iduAf984EcCwFCJKcaS0vjBgtGjIqUmUCXe/+jl0avrTZetwaJ5Hn7T3A0SeDLUsZPn4x2n0bHPQcPTwZfjnFkx0zybDNhAwCFkWDatmRlMv2f/JLM+sp0xHak6DjEcQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=giFOp2+4Us0IzLveT2ppK8Jz9CKGZ5LERC6y42T9e1MDOEosrGIbRIF6SS1tmYPElguAQoGKl1OtWsdmrpbaHdybwwI0OQe82otVcOIiwkJczAgRAdum2A31kJMgQgDoKSkyytxTv/Vn8CdXNCqGW7wXUp+TRXnJ2flthRqQO+M= Received: by 10.90.75.10 with SMTP id x10mr2559972aga.1187271324252; Thu, 16 Aug 2007 06:35:24 -0700 (PDT) Received: by 10.35.8.4 with HTTP; Thu, 16 Aug 2007 06:35:24 -0700 (PDT) Message-ID: <7262f25e0708160635j5045f35aocac8bb0b969d562@mail.gmail.com> Date: Thu, 16 Aug 2007 06:35:24 -0700 From: "Patrick Linskey" To: dev@openjpa.apache.org Subject: Re: PCEnhancer In-Reply-To: <051B157340C53E46B6DF13FD67B533FD03E74DB9@nex2004cdc.us.global.schwab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <051B157340C53E46B6DF13FD67B533FD03E74DB9@nex2004cdc.us.global.schwab.com> X-Virus-Checked: Checked by ClamAV on apache.org 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 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. > 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" 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