Hi,
I'm trying to migrate a small EJB 3.1 project from Postgres to ObjectDb to test out feasibility, but I keep getting stuck on setting up the persistence.xml on JBoss 6 AS.
Here is my setup:
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> <persistence-unit name="testUnit" transaction-type="JTA"> <provider>com.objectdb.jpa.Provider</provider> <properties> <property name="javax.persistence.jdbc.url" value="$objectdb/db/guests.odb"/> <property name="javax.persistence.jdbc.user" value="admin"/> <property name="javax.persistence.jdbc.password" value="admin"/> </properties> </persistence-unit> </persistence>
and here is the error:
2011-04-04 18:35:23,098 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (WorkerThread#0[127.0.0.1:53209]) Error installing to Start: name=persistence.unit:unitName=test.war#testUnit state=Create: java.lang.RuntimeException: Specification violation [EJB3 JPA 6.2.1.2] - You have not defined a jta-data-source for a JTA enabled persistence context named: testUnit at org.jboss.jpa.impl.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:124) [:2.0.0]
I have followed the examples also - but none refer to the jta-data-source element in the persistence.xml that I managed to find. Also, when setting up a jboss datasource it requires a SQL driver (confusing a bit!). Anyhow solved this without referring to the API ? I don't want to use the API as I much rather declarative-ly set it up.
Thanks