Did you run the OpenJPA enhancer on your classes before running the
test, or, are you running in an environment that should be doing
automatic class processing (such as a Java EE application server)?
What do you get if you set the 'openjpa.Log' property to
'MetaData=TRACE'?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
___
Notice: This email message, together with any attachments, may contain
information of BEA Systems, Inc., its subsidiaries and affiliated
entities, that may be confidential, proprietary, copyrighted and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 22, 2007 3:52 PM
> To: open-jpa-dev@incubator.apache.org
> Subject: Problem running JPA example from GlassFish page on
> GF+OpenJPA+Derby
>
> 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(MetaDat
> aRepository.java:345)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassM
> etaData(JPQLExpressionBuilder.java:164)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveCl
> assMetaData(JPQLExpressionBuilder.java:142)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid
> ateMetaData(JPQLExpressionBuilder.java:211)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid
> ateMetaData(JPQLExpressionBuilder.java:181)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid
> ateType(JPQLExpressionBuilder.java:174)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$50
> 0(JPQLExpressionBuilder.java:61)
> at
> org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQ
> L.populate(JPQLExpressionBuilder.java:1668)
> at
> org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52)
> at
> org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCom
> pilation(ExpressionStoreQuery.java:145)
> at
> org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:644)
> at
> org.apache.openjpa.kernel.QueryImpl.compilationFromCache(Query
> Impl.java:625)
> at
> org.apache.openjpa.kernel.QueryImpl.compileForCompilation(Quer
> yImpl.java:591)
> at
> org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryIm
> pl.java:653)
> at
> org.apache.openjpa.kernel.QueryImpl.getOperation(QueryImpl.java:1475)
> at
> org.apache.openjpa.kernel.DelegatingQuery.getOperation(Delegat
> ingQuery.java:120)
> at
> org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:214)
> at
> org.apache.openjpa.persistence.QueryImpl.getSingleResult(Query
> Impl.java:282)
> at ejb.TestBean.findCustomer(TestBean.java:123)
> at ejb.TestBean.verifyI