openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From László Hornyák <kocka.pub...@gmail.com>
Subject enhancement problem
Date Tue, 23 Jun 2009 06:37:57 GMT
Hi!

I am using OpenJPA 1.2.1 on jdk 1.6 and I get this exception when running a
JPA-QL.
I have the class listed in persistence.xml. I do not run enhancer, but
OpenJPA supports unenhanced classes on java 1.6.
'foo.Bar' is an abstract class and it is the superclass of most of my
persistent beans.
Also, the strange thing is that I can persist the instances of the derived
classes, but I still get this exception when I try to run a query.

org.springframework.dao.InvalidDataAccessApiUsageException: The type "class
net.sf.jsu.deadfly.beans.GenericEntity" has not been enhanced.; nested
exception is <openjpa-1.2.1-r752877:753278 fatal user error>
org.apache.openjpa.persistence.ArgumentException: The type "class foo.Bar"
has not been enhanced.
    at
org.springframework.orm.jpa.EntityManagerFactoryUtils.convertJpaAccessExceptionIfPossible(EntityManagerFactoryUtils.java:271)
    at
org.springframework.orm.jpa.DefaultJpaDialect.translateExceptionIfPossible(DefaultJpaDialect.java:120)
    at
org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:212)
    at
org.springframework.orm.jpa.JpaAccessor.translateIfNecessary(JpaAccessor.java:152)
    at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:189)
    at org.springframework.orm.jpa.JpaTemplate.execute(JpaTemplate.java:147)
    at
foo.logic.impl.jpa.JpaSurveyService.getSurveybyUniName(JpaSurveyService.java:63)
    at foo.logic.LogicTest$1.doInTransaction(LogicTest.java:45)
    at
org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:128)
    at foo.logic.LogicTest.testCanTakeSurvey(LogicTest.java:42)
    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.junit.internal.runners.TestMethod.invoke(TestMethod.java:66)
    at
org.junit.internal.runners.MethodRoadie.runTestMethod(MethodRoadie.java:105)
    at
org.unitils.UnitilsJUnit4TestClassRunner$TestListenerInvokingMethodRoadie.runTestMethod(UnitilsJUnit4TestClassRunner.java:174)
    at org.junit.internal.runners.MethodRoadie$2.run(MethodRoadie.java:86)
    at
org.junit.internal.runners.MethodRoadie.runBeforesThenTestThenAfters(MethodRoadie.java:94)
    at
org.unitils.UnitilsJUnit4TestClassRunner$TestListenerInvokingMethodRoadie.runBeforesThenTestThenAfters(UnitilsJUnit4TestClassRunner.java:156)
    at org.junit.internal.runners.MethodRoadie.runTest(MethodRoadie.java:84)
    at org.junit.internal.runners.MethodRoadie.run(MethodRoadie.java:49)
    at
org.unitils.UnitilsJUnit4TestClassRunner.invokeTestMethod(UnitilsJUnit4TestClassRunner.java:95)
    at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:61)
    at
org.unitils.UnitilsJUnit4TestClassRunner.access$000(UnitilsJUnit4TestClassRunner.java:44)
    at
org.unitils.UnitilsJUnit4TestClassRunner$1.run(UnitilsJUnit4TestClassRunner.java:62)
    at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:34)
    at
org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:44)
    at
org.unitils.UnitilsJUnit4TestClassRunner.run(UnitilsJUnit4TestClassRunner.java:68)
    at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
    at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: <openjpa-1.2.1-r752877:753278 fatal user error>
org.apache.openjpa.persistence.ArgumentException: The type "class foo.Bar"
has not been enhanced.
    at
org.apache.openjpa.meta.ClassMetaData.resolveMeta(ClassMetaData.java:1652)
    at
org.apache.openjpa.meta.ClassMetaData.resolve(ClassMetaData.java:1626)
    at
org.apache.openjpa.meta.MetaDataRepository.processBuffer(MetaDataRepository.java:717)
    at
org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:616)
    at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:541)
    at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
    at
org.apache.openjpa.meta.MetaDataRepository.resolveMeta(MetaDataRepository.java:581)
    at
org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRepository.java:541)
    at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:308)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:170)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:139)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:225)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:195)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:188)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$600(JPQLExpressionBuilder.java:69)
    at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1756)
    at
org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:56)
    at
org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:153)
    at
org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:658)
    at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:639)
    at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:605)
    at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:667)
    at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1492)
    at
org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
    at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:243)
    at
org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:294)


Thank you!


-- 
László Hornyák

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