Hi,
I am trying to use JTA with my Rife Application.
My participants.xml looks like this
<rep>
<property name="HotelBooking"><participant name="hotel"/></property>
<participant param="rep/config.xml">ParticipantConfig</participant>
<participant param="sites/helloworld.xml">ParticipantSite</
participant>
<participant param="rep/datasources.xml">ParticipantDatasources</
participant>
<participant param="rep/persistence.xml"
name="hotel">hotelbooking.participant.ParticipantPersistence</
participant>
</rep>
Datasource.xml looks like this
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
- Distributed under the terms of either:
- * the common development and distribution license (CDDL), v1.0;
or
- * the GNU Lesser General Public License, v2.1 or later
- $Id: datasources.xml 3634 2007-01-08 21:42:24Z gbevin $
-->
<!DOCTYPE datasources SYSTEM "/dtd/datasources.dtd">
<datasources>
<datasource name="mysql">
<driver>com.mysql.jdbc.Driver</driver>
<url>jdbc:mysql://localhost:3306/rife</url>
<user>root</user>
<password>root</password>
<poolsize>5</poolsize>
</datasource>
</datasources>
and persistence.xml looks like this
<persistence-unit name="HotelBooking" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>hotelbooking.entity.User</class>
<class>hotelbooking.entity.UserRole</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.connection.driver_class"
value="com.mysql.jdbc.Driver"/>
<property name="hibernate.connection.url" value="jdbc:mysql://
192.168.144.109/rife"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="root"/>
</properties>
</persistence-unit>
</persistence>
I am trying to access this using
EntityManagerFactory emf = Persistence.createEntityManagerFactory
("HotelBooking");
his.em = emf.createEntityManager();
in my java file.
While deploying i am getting the eror
SEVERE: Error on host localhost:8080//rife-jumpstart
javax.persistence.PersistenceException:
org.hibernate.HibernateException: The chosen transaction strategy
requires access to the JTA TransactionManager
Can anybody help me out with this one?
Thanks in advance.