openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ben short" <jamin.sh...@gmail.com>
Subject 1.0.0 The type "class" has not been enhanced.
Date Wed, 29 Aug 2007 20:52:45 GMT
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 - <t 9194103, conn
7143488> executing prepstmnt 25621063 SELECT SEQUENCE_SCHEMA,
SEQUENCE_NAME FROM INFORMATION_SCHEMA.SYSTEM_SEQUENCES
438  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
7143488> [0 ms] spent
438  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
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 - <t 9194103, conn
5285449> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
1067475> executing stmnt 33189144 CREATE TABLE Product (id INTEGER NOT
NULL IDENTITY, version INTEGER)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
1067475> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
9716945> executing stmnt 21658130 CREATE TABLE ProductInstance (id
INTEGER NOT NULL IDENTITY, version INTEGER)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
9716945> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
32486590> executing stmnt 2830910 CREATE TABLE Product_ProductInstance
(Product_id INTEGER, mProductInstances_id INTEGER)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
32486590> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
7858936> executing stmnt 30983464 CREATE INDEX
I_TTRBDVL_MPRODUCTINSTANCE ON AttributeAndValue (mProductInstance_id)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
7858936> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
10127976> executing stmnt 14900151 CREATE INDEX I_PRDCTNC_ELEMENT ON
Product_ProductInstance (mProductInstances_id)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
10127976> [0 ms] spent
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
17010151> executing stmnt 32826737 CREATE INDEX I_PRDCTNC_PRODUCT_ID
ON Product_ProductInstance (Product_id)
454  openjpa  TRACE  [main] openjpa.jdbc.SQL - <t 9194103, conn
17010151> [0 ms] spent
Exception in thread "main" <openjpa-1.0.0-rType 'svnversion --help'
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

Mime
View raw message