Announcement Announcement Module
Collapse
No announcement yet.
Jtatrasactionmanager without container managed resources Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jtatrasactionmanager without container managed resources

    Hi all,

    Sorry for spamming again but i am stuck at this point in the half way
    Plz help me.

    I am using 2 Session factories in my application As following. With Jtatrasactionmanger (As i need to perform DB operation on those two databases at the same time (Kind of replication of data))
    Code:
    <bean id="firstSessionFactory" class="org.springframework.orm.hibernate3LocalSessionFactoryBean">
    .
    .
    .
    </bean>
    <bean id="secondSessionFactory" class="org.springframework.orm.hibernate3LocalSessionFactoryBean">
    .
    .
    .
    </bean>
    
    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager" >
    This is working obsolutely fine when i deploy it on Jboss -- I am exposing Web services here.

    But when i use testNg to unit test the application it is throwing exceptions.

    If i include jta.jar then it says

    Code:
    java.lang.IllegalStateException: Either 'userTransaction' or  'userTransactionName' or 'transactionManager' or 'transactionManagerName' must be specified
    otherwise i get
    Code:
    NoClassDefFoundError: javax/transaction/TransactionManager ......
    Any help in this regard is appreciated...

    thanks in advance..

  • #2
    If you want to test you will need a JtaTransactionmanager which runs without a container. Take a look at JOTM for that purpose.

    Comment


    • #3
      If you want to test you will need a JtaTransactionmanager ---(JOTM)

      Thank you very much.. I will be trying out with JOTM.

      Comment

      Working...
      X