Getting JTA TransactionManager Error

2 views
Skip to first unread message

Rahul

unread,
Apr 3, 2009, 2:01:56 AM4/3/09
to rife-users
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.

Geert Bevin

unread,
Apr 3, 2009, 2:12:16 AM4/3/09
to rife-...@googlegroups.com
I have not enough Hibernate experience to help you with this. It would
be worth investigating of this also happens without RIFE, ie. just
deploying a servlet with this Hibernate code. I think it might be that
a transaction manager is not setup by your container. RIFE doesn't
integrate with JTA, so it doesn't setup a transaction manager.

HTH,

Geert
--
Geert Bevin
Terracotta - http://www.terracotta.org
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Flytecase Band - http://flytecase.be
Music and words - http://gbevin.com

Rahul

unread,
Apr 3, 2009, 2:18:29 AM4/3/09
to rife-users
Yes Geert, thats the main issue i.e of configuration. Thats what I am
looking for here. Something wrong with the configuration.
Is there any link, example or sample code that does this integration?
> Terracotta -http://www.terracotta.org
> Uwyn "Use what you need" -http://uwyn.com

Geert Bevin

unread,
Apr 3, 2009, 2:20:41 AM4/3/09
to rife-...@googlegroups.com
Not within RIFE, I suggest your look in Hibernate land for what's
needed. RIFE doesn't use JTA.
Reply all
Reply to author
Forward
0 new messages