0

我得到了这个例外。

<openjpa-1.0.5-SNAPSHOT-r420667:1227246 fatal user error> org.apache.openjpa.persistence.ArgumentException: Could not locate metadata for the class using alias "Customer". This could mean that the OpenJPA enhancer or load-time weaver was not run on the type whose alias is "Customer". Registered alias mappings: "{Customer=null}"
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:363)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:169)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:147)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:216)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:186)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:179)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500(JPQLExpressionBuilder.java:66)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1685)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:55)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:148)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:652)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:633)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:599)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:661)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1487)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:123)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:228)
[9/11/12 14:12:57:958 EDT] 0000019a SystemErr     R     at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:278)

我的 Ant 脚本中有一个增强器任务。

我看到我的类得到了增强,类文件的大小增加了,但我仍然得到上述异常。

4

1 回答 1

0

在您的 persistence.xml 文件中列出您的持久类型。

于 2012-09-17T01:00:22.737 回答