Specification violation EJB3 JPA 6.2.1.2
fenixx Apr 1, 2009 1:41 PMHi all,
I want to start my TestNG-Test in the Embedded JBoss with Maven.
Here is my persistence.xml in the src/test/resources/META-INF folder:
<?xml version="1.0" encoding="UTF-8"?> <persistence 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_1_0.xsd" version="1.0"> <persistence-unit name="MyProjectTest"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <!-- My-Classes --> <class>my.classes.are.listed.here</class> <properties> <property name="hibernate.archive.autodetection" value="class, hbm" /> <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect" /> <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver" /> <property name="hibernate.connection.url" value="jdbc:hsqldb:." /> <property name="hibernate.connection.username" value="sa" /> <property name="hibernate.connection.password" value="" /> <property name="hibernate.hbm2ddl.auto" value="create-drop" /> <property name="hibernate.jdbc.batch_size" value="20" /> <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/> </properties> </persistence-unit> </persistence>
If I execute the test with Maven I get the following error:
ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=persistence.units:unitName=MyProjectTest 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: MyProjectTest at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:230)[...] at org.testng.SuiteRunner.privateRun(SuiteRunner.java:262) at org.testng.SuiteRunner.run(SuiteRunner.java:191) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:808) at org.testng.TestNG.runSuitesLocally(TestNG.java:776) at org.testng.TestNG.run(TestNG.java:701)
Are the settings of the persistence.xml incorrect, or it is a bug?
Any help appreciated.
Regards