7 Replies Latest reply: May 31, 2012 10:16 AM by Martin Gencur RSS

Can not find TransactionManager with JBossStandaloneJTAManagerLookup

dex chen Novice

I have a simple test code which configure to use JBossStandaloneJTAManagerLookup. With ISPN 5.1.4 Final, I ran into errors which ISPN complains: No transaction manager could be found ...

 

I did include the depencies for Jboss jars:

  <dependency> 
     <groupId>org.infinispan</groupId>  
     <artifactId>infinispan-core</artifactId>
     <version>${infinispan.version}</version>
  </dependency>
  <dependency> 
     <groupId>org.infinispan</groupId>  
     <artifactId>infinispan-cachestore-jdbm</artifactId>
     <version>${infinispan.version}</version>
  </dependency>
  <dependency> 
     <groupId>org.infinispan</groupId>  
     <artifactId>infinispan-cachestore-jdbc</artifactId>
     <version>${infinispan.version}</version>
  </dependency>
  <dependency>
  <groupId>apache-log4j</groupId>
  <artifactId>log4j</artifactId>
  <version>1.2.15</version>
 
  </dependency>
  <dependency>
  <groupId>com.h2database</groupId>
  <artifactId>h2</artifactId>
  <version>1.3.162</version>
  </dependency>
  <dependency>
  <groupId>org.jboss.jbossts</groupId>
  <artifactId>jbossjta</artifactId>
  <version>4.15.3.Final</version>
  </dependency>
   <dependency>
  <groupId>org.apache.commons</groupId>
  <artifactId>commons-lang3</artifactId>
  <version>3.1</version>
 

</dependency>

 

The infnispan config is simple:

   <default>

     <locking concurrencyLevel="5000" isolationLevel="READ_COMMITTED" lockAcquisitionTimeout="1500" useLockStriping="false" writeSkewCheck="false"/>

      <!--

         Used to register a transaction manager and participate in JTA and XA transactions.

 

         See:

 

            http://community.jboss.org/wiki/Infinispantransactions

      -->

      <transaction cacheStopTimeout="30000" eagerLockSingleNode="false" syncCommitPhase="false" syncRollbackPhase="false" transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup" useEagerLocking="false"/>

      <!--

         Enables deadlock detection.  See:

 

         http://community.jboss.org/wiki/Infinispantransactions#deadlock

 

      -->

      <deadlockDetection enabled="true" spinDuration="1000"/>

      <jmxStatistics enabled="false"/>

     

    </default>

 

If I switch the lookup class to DummyTransactionManagerLookup with the exact same code, it finds the TransactionManager.

 

Anyone sees this issue?  Or I missed somthing here?

  • 1. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Martin Gencur Novice

    Maybe you could provide more information about the error message.

     

    Anyway, please have a look at https://github.com/mgencur/infinispan-examples/blob/master/carmart-tx-jdbc/pom.xml

     

    I finished the example yesterday and will soon write an article about configuring this. The carmart-tx-jdbc works in both JBossAS7 and Tomcat 7. You'll need to look at "tomcat" profile in the pom.xml file as it is using JBoss Transaction Manager, and it works ! To find all dependencies, run "mvn dependency:tree -Ptomcat".

     

    Configuration of Infinispan is done via Java API in https://github.com/mgencur/infinispan-examples/blob/master/carmart-tx-jdbc/src/tomcat/java/org/infinispan/examples/carmart/session/TomcatCacheContainerProvider.java

     

    Hope it helps

  • 2. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Balaji Ramalingam Newbie

    Hi dex chen,

     

    Did you manage to solve this problem ? I am as well facing the same issue. I believe you have gone passed this issue. It would be of great help if you can share your approach in getting this fixed.

     

     

    Thanks for your time !

  • 3. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    dex chen Novice

    It most likely is a configuration issue. It works with me now when I configured the cache loader correctly. 

  • 4. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Balaji Ramalingam Newbie

    Can you please validate this configuration ?

     

    <loaders passivation="true" shared="false" preload="false">

                                  <loader class="org.infinispan.loaders.file.FileCacheStore"

                                            fetchPersistentState="false" ignoreModifications="true"

                                            purgeOnStartup="true" purgerThreads="25">

                                            <properties>

                                                      <property name="location" value="/home/balaji/" />

                                            </properties>

                                  </loader>

                        </loaders>

                        <locking writeSkewCheck="false" useLockStriping="false"

                                  lockAcquisitionTimeout="60000" isolationLevel="READ_COMMITTED"

                                  concurrencyLevel="1000" />

                        <transaction useSynchronization="true" transactionMode="TRANSACTIONAL"

                                  useEagerLocking="false"

                                  transactionManagerLookupClass="org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup"

                                  use1PcForAutoCommitTransactions="false" syncRollbackPhase="false"

                                  syncCommitPhase="true" lockingMode="OPTIMISTIC" eagerLockSingleNode="true"

                                  cacheStopTimeout="30000" autoCommit="false">

                        </transaction>

     

    Thanks for your time !

  • 5. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Galder Zamarreño Master

    The cache loader configuration looks odd. You can a file cache store which you wipe out on startup, but it's not writeable...

     

    eagerLockSingleNode is deprecated, starting with Infinispan 5.1.x, it always works that way.

  • 6. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Balaji Ramalingam Newbie

    I was looking to have feature similar to overflow-to-disk. So, Only on eviction I expect the entries to be on the file. As the entries are NOT required across server startup, I have set the purgeonstartup to true.

     

    <loaders passivation="true" shared="false" preload="false">

                                  <loader class="org.infinispan.loaders.file.FileCacheStore"

                                            fetchPersistentState="false" ignoreModifications="true"

                                            purgeOnStartup="true" purgerThreads="25">

                                            <properties>

                                                      <property name="location" value="/home/balaji/" />

                                            </properties>

                                  </loader>

                        </loaders>

     

     

    Is it the problem with ignoreModifications flag ?

     

    Also, One more scenario to clarify.

     

    Let's say I have set the eviction policy with maxEntries = 5 & strategy = FIFO, expiration maxIdle time being set to 1000millisecs, llifespan set to 300000(5 minutes) - I am trying to add 6 entries to cache. Before adding 6th entry, 1 entry has to be evicted as the cache maxEntries is reached. As I have configured the filestore, it should have been passivated (per configuration this is enabled) on to the store.

     

    After immediately adding 6th entry, I am trying to retrieve the 1st entry from the cache. This should get the entry by activating the entry from filestore. But this is NOT happening and am getting a null value. Can you please validate my understanding ?

  • 7. Re: Can not find TransactionManager with JBossStandaloneJTAManagerLookup
    Martin Gencur Novice

    Yes, the problem is ignoreModifications="true" -> you cannot write anything to the cache store so it remains empty. Btw, if you set maxEntries to 5, the actual maxEntries will be 8 -> the nearest higher power of 2 is set to it. And there might be problems with so low numbers on some JVM types. It's simply constructed for higher values.