Results 1 to 2 of 2

Thread: How to configure Transaction Manager in spring+cloudfoundry application

  1. #1

    Unhappy How to configure Transaction Manager in spring+cloudfoundry application

    Hi,

    I have written a simple spring+hibernate app for cloud foundry.

    I have configured transaction manager following ways:

    Tried -1:
    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTran sactionManager">
    <property name="userTransactionName">
    <value>UserTransaction</value>
    </property>
    </bean>

    Tried-2:
    bean id="transactionManager" class="org.springframework.transaction.jta.JtaTran sactionManager">

    <property name="transactionManagerName" value="java:/TransactionManager" />
    <property name="allowCustomIsolationLevels" value="true" />
    </bean>


    Error:

    13 Jul 2011 18:03:58 - org.apache.slide.common.Domain - INFO - Namespace configuration complete
    org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'transactionManager' defined in class path resource [root-context.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.TransactionSystemE xception: JTA UserTransaction is not available at JNDI location [UserTransaction]; nested exception is javax.naming.NameNotFoundException: Name UserTransaction is not bound in this Context
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1420)


    Could you please tell me the how to configure transaction manager in spring+cloud foundry applications.

  2. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,629

    Default

    Please use [ code][/code ] tags when posting code ..

    CloudFoundry doesn't support JTA because it runs on tomcat. Either switch to another transaction manager or configure your own local JTA (like atomikos). However if you are only using hibernate either use the HibernateTransactionManager (if you use plain hibernate) or if you use jpa use JpaTransactionManager.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •