openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marina Vatkina <Marina.Vatk...@Sun.COM>
Subject Problem running JPA example from GlassFish page on GF+OpenJPA+Derby
Date Thu, 22 Mar 2007 22:51:34 GMT
Hi,

I tried to run our simple JPA example that can be found under (src and all) 
https://glassfish.dev.java.net/javaee5/persistence/persistence-example.html
adding OpenJPA as the provider provider, and 'drop and create' tables settings 
to persistence.xml.

The test inserts a customer and 2 orders, then runs a JPQL query to verify the 
insert, followed by delete and again verify.

The same example works correctly on Oracle. I used the snapshot downloaded 
yesterday.

1. Derby had been identified correctly:
[#|2007-03-22T14:55:01.920-0700|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=20;_ThreadName=p:


thread-pool-1; w: 3;_RequestID=80f667e2-03ab-4ccd-bb17-b8b4d0a88698;|495041  pu1
   INFO   [p: thread-pool-1; w: 3] openjpa.jdbc.JDBC - OpenJPA will now connect
to the database to attempt to determine what type of database dictionary to use.
   To prevent this connection in the future, set your openjpa.jdbc.DBDictionary
configuration property to the appropriate value for your database (see the
documentation for available values).
|#]

[#|2007-03-22T14:55:02.876-0700|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=20;_ThreadName=p:


thread-pool-1; w: 3;_RequestID=80f667e2-03ab-4ccd-bb17-b8b4d0a88698;|495997  pu1
   INFO   [p: thread-pool-1; w: 3] openjpa.jdbc.JDBC - Using dictionary class
"org.apache.openjpa.jdbc.sql.DerbyDictionary" (Apache Derby 10.2.2.0 - (485682)
,Apache Derby Network Client JDBC Driver 10.2.2.0 - (485682)).
|#]

2. verifyInsert failed with:

Caused by: <4|true|0.9.7-incubating-SNAPSHOT>
org.apache.openjpa.persistence.ArgumentException: Could not locate metadata for
the class using alias "Customer". Registered alias mappings: "{Customer=null}"
          at
org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDataRepository.java:345)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData(JPQLExpressionBuilder.java:164)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaData(JPQLExpressionBuilder.java:142)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:211)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaData(JPQLExpressionBuilder.java:181)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType(JPQLExpressionBuilder.java:174)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500(JPQLExpressionBuilder.java:61)
          at
org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQL.populate(JPQLExpressionBuilder.java:1668)
          at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52)
          at
org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation(ExpressionStoreQuery.java:145)
          at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:644)
          at
org.apache.openjpa.kernel.QueryImpl.compilationFromCache(QueryImpl.java:625)
          at
org.apache.openjpa.kernel.QueryImpl.compileForCompilation(QueryImpl.java:591)
          at
org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryImpl.java:653)
          at org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1475)
          at
org.apache.openjpa.kernel.DelegatingQuery.getOperation(DelegatingQuery.java:120)
          at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:214)
          at
org.apache.openjpa.persistence.QueryImpl.getSingleResult(QueryImpl.java:282)
          at ejb.TestBean.findCustomer(TestBean.java:123)
          at ejb.TestBean.verifyInsert(TestBean.java:78)

thanks,
-marina



Mime
View raw message