Did you add the Message class to your persistence.xml? I just love OpenJPA error messages, about as useful as tits on a bull:
"..The configuration property named "openjpa.Id" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.Id" ..." Looks like the same spelling and capitalisation to me, who the hell writes these messages? The only useful word in this message is "error" Chris -----Original Message----- From: hezjing [mailto:[email protected]] Sent: Friday, 23 April 2010 12:46 AM To: [email protected] Subject: Problem build and run hellojpa using Maven Hi I have successfully ran the hellojpa sample as described in the getting started with Netbeans and Ant. Now, I'm trying to build and run the same sample using Maven. When the goal exec:exec is executed, the following ArgumentException is thrown: 0 WARN [main] openjpa.Runtime - The configuration property named "openjpa.Id" was not recognized and will be ignored, although the name closely matches a valid property called "openjpa.Id". Exception in thread "main" <openjpa-1.2.2-r422266:898935 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: Attempt to cast instance "hellojpa.mess...@1094d48" to PersistenceCapable failed. Ensure that it has been enhanced. FailedObject: hellojpa.mess...@1094d48 at org.apache.openjpa.kernel.BrokerImpl.assertPersistenceCapable(BrokerImpl.java:4377) at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2443) at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2304) at org.apache.openjpa.kernel.DelegatingBroker.persist(DelegatingBroker.java:1021) at org.apache.openjpa.persistence.EntityManagerImpl.persist(EntityManagerImpl.java:645) at hellojpa.Main.main(Main.java:54) Here are the snippets of my pom.xml: <dependency> <groupId>org.apache.openjpa</groupId> <artifactId>openjpa</artifactId> <version>1.2.2</version> <scope>compile</scope> </dependency> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>10.5.3.0</version> </dependency> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <version>1.1.1</version> <configuration> <executable>java</executable> <arguments> <argument>-Dopenjpa.ConnectionDriverName=org.apache.derby.jdbc.EmbeddedDriver</argument> <argument>-Dopenjpa.ConnectionURL=jdbc:derby:openjpa-database;create=true</argument> <argument>-Dopenjpa.ConnectionUserName=</argument> <argument>-Dopenjpa.ConnectionPassword=</argument> <argument>-Dopenjpa.jdbc.SynchronizeMappings=buildSchema</argument> <argument>-Dopenjpa.Log=DefaultLevel=WARN,SQL=TRACE</argument> <argument>-classpath</argument> <classpath/> <argument>hellojpa.Main</argument> </arguments> </configuration> </plugin> Do you have any idea of what could be the problem? -- Hez
