2 Replies Latest reply on Oct 28, 2006 5:47 AM by Ales Justin

    JNDI transaction outside of container

    Tim Newbie

      I cant seem to get the TransactionManager and UserTransaction when running junit tests from outside the server.

      I've tried many thing including:
      <jee:jndi-lookup id="transactionManager" jndi-name="java:TransactionManager">
      <jee:environment>java.naming.provider.url=localhost:20350</jee:environment>
      </jee:jndi-lookup>

      <!-- spring jta transaction manager -->



      UserTransaction



      Is it possible to get the TransactionManager and UserTransaction if you are not running from within the jvm of the container?
      Has anyone tried this before?

        • 1. Re: JNDI transaction outside of container
          Tim Newbie

          Forget this issue. I got it working now.
          But I am getting:

          [junit] Caused by: org.springframework.transaction.TransactionSystemException: JTA TransactionManager is not available at JNDI location [java:TransactionManager]; nested exception is javax.naming.NameNotFoundException: TransactionManager not bound
          [junit] at org.springframework.transaction.jta.JtaTransactionManager.lookupTransactionManager(JtaTransactionManager.java:474)
          [junit] at org.springframework.transaction.jta.JtaTransactionManager.afterPropertiesSet(JtaTransactionManager.java:379)
          [junit] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1062)
          [junit] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1029)
          [junit] ... 48 more
          [junit] Caused by: javax.naming.NameNotFoundException: TransactionManager not bound

          Even though I can clearly see the TransactionManager bound in the JNDIView.

          I am running these tests thru JUnit to a JBoss server running locally.
          Is there something special I have to do if the tests are outside the JBoss container?