Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 12892 invoked from network); 29 Aug 2007 21:17:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Aug 2007 21:17:26 -0000 Received: (qmail 57853 invoked by uid 500); 29 Aug 2007 21:17:22 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 57786 invoked by uid 500); 29 Aug 2007 21:17:22 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 57777 invoked by uid 99); 29 Aug 2007 21:17:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 14:17:21 -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 64.233.166.182 as permitted sender) Received: from [64.233.166.182] (HELO py-out-1112.google.com) (64.233.166.182) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2007 21:17:18 +0000 Received: by py-out-1112.google.com with SMTP id f47so558371pye for ; Wed, 29 Aug 2007 14:16:57 -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=VsNbKz5geUXbsu0PAZrHZOe5ajmTYh/HuxW1l2qriME2bRDV4cMcWugCBOAtBYlmtUdQ5T2SHdvXiBnDqaGfqqHL7SwPkC+UYbBq8mt54FWg2K54CBT9KxzKNDV9L7EA+JLbZLxjiLk64qv2/LYQl58AyFo52wnllsROMVOQkWg= 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=hNgsUGfweLT7m3/8myV9buRq6JEEbx9EZm1R2xUtUxqkP163EgyKB2SrJeVSmr5UQIKoNM4u3Wisxnd/BZpNrCDTBTp+aG477sZrymE9zSlLYbHG8VYkSopu8gXt1TDvS8xOQ3lVnzscNJ97PQnd95VzyUilptWyKY7jaYkXqpY= Received: by 10.35.121.9 with SMTP id y9mr1272701pym.1188422217617; Wed, 29 Aug 2007 14:16:57 -0700 (PDT) Received: by 10.35.100.9 with HTTP; Wed, 29 Aug 2007 14:16:57 -0700 (PDT) Message-ID: <7262f25e0708291416l76faf029t33595d7170a95720@mail.gmail.com> Date: Wed, 29 Aug 2007 14:16:57 -0700 From: "Patrick Linskey" To: users@openjpa.apache.org Subject: Re: 1.0.0 The type "class" has not been enhanced. In-Reply-To: <86aa493a0708291352n4939271bi27e52d304dd046df@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <86aa493a0708291352n4939271bi27e52d304dd046df@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org > I download the 1.0.0 source and ran mvn install. It built and > installed ok. I use either the maven enhance plugin or the ant task to > enhance the classes. When I run my simple test app I get the following > exception... Is there any way we could get access to that test application? I kinda suspect some sort of classloader issue, as I can't see how the isManagedType() call would otherwise fail. Also, can you work around it by setting the openjpa.RuntimeUnenhancedClasses property to 'disabled'? > Also i think the following ddl is incorrect.. > > CREATE TABLE AttributeAndValue (id INTEGER NOT NULL IDENTITY, > mAttribute VARCHAR(255), mValue VARCHAR(255), version INTEGER, > mProductInstance_id INTEGER, UNIQUE (mValue)) > > this is the @Table annotation used on the AttributeAndValue class. > > @Table(uniqueConstraints=@UniqueConstraint(columnNames={ > "mProductInstance, mAttribute", "mValue"})) IIRC, OpenJPA does not currently support multi-column unique constraints. I think that there is work in progress to resolve this, though. -Patrick On 8/29/07, ben short wrote: > Hi, > > I download the 1.0.0 source and ran mvn install. It built and > installed ok. I use either the maven enhance plugin or the ant task to > enhance the classes. When I run my simple test app I get the following > exception... > > 32 openjpa INFO [main] openjpa.Runtime - Starting OpenJPA 1.0.0 > 438 openjpa TRACE [main] openjpa.jdbc.SQL - 7143488> executing prepstmnt 25621063 SELECT SEQUENCE_SCHEMA, > SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES > 438 openjpa TRACE [main] openjpa.jdbc.SQL - 7143488> [0 ms] spent > 438 openjpa TRACE [main] openjpa.jdbc.SQL - 5285449> executing stmnt 6109469 CREATE TABLE AttributeAndValue (id > INTEGER NOT NULL IDENTITY, mAttribute VARCHAR(255), mValue > VARCHAR(255), version INTEGER, mProductInstance_id INTEGER, UNIQUE > (mValue)) > 438 openjpa TRACE [main] openjpa.jdbc.SQL - 5285449> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 1067475> executing stmnt 33189144 CREATE TABLE Product (id INTEGER NOT > NULL IDENTITY, version INTEGER) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 1067475> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 9716945> executing stmnt 21658130 CREATE TABLE ProductInstance (id > INTEGER NOT NULL IDENTITY, version INTEGER) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 9716945> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 32486590> executing stmnt 2830910 CREATE TABLE Product_ProductInstance > (Product_id INTEGER, mProductInstances_id INTEGER) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 32486590> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 7858936> executing stmnt 30983464 CREATE INDEX > I_TTRBDVL_MPRODUCTINSTANCE ON AttributeAndValue (mProductInstance_id) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 7858936> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 10127976> executing stmnt 14900151 CREATE INDEX I_PRDCTNC_ELEMENT ON > Product_ProductInstance (mProductInstances_id) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 10127976> [0 ms] spent > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 17010151> executing stmnt 32826737 CREATE INDEX I_PRDCTNC_PRODUCT_ID > ON Product_ProductInstance (Product_id) > 454 openjpa TRACE [main] openjpa.jdbc.SQL - 17010151> [0 ms] spent > Exception in thread "main" for usage. fatal user error> > org.apache.openjpa.persistence.ArgumentException: The type "class > com.daisytechnologies.jpatest.ProductInstance" has not been enhanced. > at org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1631) > at org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1605) > at org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:675) > at org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:575) > at org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:500) > at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:302) > at org.apache.openjpa.enhance.ManagedClassSubclasser.setIntercepting(ManagedClassSubclasser.java:264) > at org.apache.openjpa.enhance.ManagedClassSubclasser.prepareUnenhancedClasses(ManagedClassSubclasser.java:157) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.apache.openjpa.kernel.AbstractBrokerFactory.loadPersistentTypes(AbstractBrokerFactory.java:287) > at org.apache.openjpa.kernel.AbstractBrokerFactory.newBroker(AbstractBrokerFactory.java:197) > at org.apache.openjpa.kernel.DelegatingBrokerFactory.newBroker(DelegatingBrokerFactory.java:142) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:192) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:145) > at org.apache.openjpa.persistence.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:56) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean$ManagedEntityManagerFactoryInvocationHandler.invoke(AbstractEntityManagerFactoryBean.java:375) > at $Proxy0.createEntityManager(Unknown Source) > at com.daisytechnologies.jpatest.Main.insert(Main.java:45) > at com.daisytechnologies.jpatest.Main.main(Main.java:39) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) > > But if i use the 0.9.8-SNAPSHOT version without recompiling or > enhancing the classes it works OK. > > The same issue occurred with a postgres setup. > > Also i think the following ddl is incorrect.. > > CREATE TABLE AttributeAndValue (id INTEGER NOT NULL IDENTITY, > mAttribute VARCHAR(255), mValue VARCHAR(255), version INTEGER, > mProductInstance_id INTEGER, UNIQUE (mValue)) > > this is the @Table annotation used on the AttributeAndValue class. > > @Table(uniqueConstraints=@UniqueConstraint(columnNames={ > "mProductInstance, mAttribute", "mValue"})) > > Ben > -- Patrick Linskey 202 669 5907