10 Replies Latest reply on Dec 4, 2011 5:02 AM by agrawal24_7

    question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup

    yelin666

      We need to use org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup, inside the constructor of that class, it has:

      manager = Util.loadClassStrict("com.arjuna.ats.jta.TransactionManager").getMethod("transactionManager");
      user = Util.loadClassStrict("com.arjuna.ats.jta.UserTransaction").getMethod("userTransaction");

       

      Both com.arjuna.ats.jta.TransactionManager & com.arjuna.ats.jta.UserTransaction are in the jbossjta.jar. However, there is no dependency claimed in any Infinispan POM and it's not in Infinispan download. Should the infinispan-core POM claims dependency on it? Otherwise, how are we supposed to use org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup (having the dependency in our POM directly is kind of strange).

       

      Another question is - when we configure the cache, if we call configuration.setInvocationBatchingEnabled(true), it automatically enable transaction. In that case, I am wondering which TransactionManagerLookup class would be used to get a reference to the TransactionManager in the environment.

        • 1. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
          manik

          Infinispan doesn't depend on JBoss TM directly since Infinispan works with any JTA compliant TM (e.g., ones from Oracle, IBM, etc).

           

          When you set invocation batching to true, it will use whichever TM you have configured or have available on your system.  The log messages should help you figure out which TM is being used when you start the cache.

          • 2. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
            yelin666

            Manik, thanks for the response.

             

            One more question here - if I include jbossjta.jar in my classpath, I got the following exception. I understand this may be out of scope for Infinispan, but could you please suggest which JBoss team should I talk to get more information?

            Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.arjuna.ats.jta.common.jtaPropertyManager
                    at com.arjuna.ats.jta.utils.JNDIManager.getTransactionManagerImplementationClassname(JNDIManager.java:69)
                    at com.arjuna.ats.jta.TransactionManager.transactionManager(TransactionManager.java:93)
                    at com.arjuna.ats.jta.TransactionManager.transactionManager(TransactionManager.java:76)

            • 3. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
              manik

              You need to grab these:

               

                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossjta</artifactId>
                       <version>${version.jbossjta}</version>
                       <scope>test</scope>
                    </dependency>
                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossjts</artifactId>
                       <version>${version.jbossjts}</version>
                       <scope>test</scope>
                    </dependency>
                    <dependency>
                       <groupId>commons-logging</groupId>
                       <artifactId>commons-logging</artifactId>
                       <version>${version.commons.logging}</version>
                       <scope>test</scope>
                    </dependency>
                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossts-common</artifactId>
                       <version>${version.jbossts-common}</version>
                       <scope>test</scope>
                    </dependency>
                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossjta</artifactId>
                       <version>${version.jbossjta}</version>
                    </dependency>
                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossjts</artifactId>
                       <version>${version.jbossjts}</version>
                    </dependency>
                    <dependency>
                       <groupId>jboss.jbossts</groupId>
                       <artifactId>jbossts-common</artifactId>
                       <version>${version.jbossts-common}</version>
                    </dependency>
              
              • 4. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                yelin666

                Thanks, do you have the matching versions information for them? I am using 4.4.0.GA for jbossjta, jbossjts and jbossts-common, but still got the following:

                Caused by: org.apache.commons.logging.LogConfigurationException: User-specified log class 'com.arjuna.common.internal.util.logging.jakarta.Log4JLogger' cannot be found or is not useable.
                        at org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:798)
                        at org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:601)
                        at org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:333)
                        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:664)
                        at com.arjuna.common.internal.util.logging.jakarta.JakartaLogFactory.getLog(JakartaLogFactory.java:104)

                • 5. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                  manik

                  You will want commons-logging as well then.  :-)  (and you should also complain on the JBossTS forums that their POMs don't declare transitive dependencies properly - you should just have to declare a dep on a single JBossTS artefact which would pull down everything else it needs!)

                  • 6. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                    yelin666

                    I already get commons-logging-1.1.0.jboss.jar. I am getting the following exception now, and both JakartaLogFactory.java & Log4JLogger, that it complained about, are inside jbossts-common-4.4.0.GA.jar. Not sure why it complained, and I don't see the source jar file in the maven repositary, that I can use to check out the source code. If you get any hint, please let me know. I'll try the JBossTS forum per your suggestion:-)

                    Caused by: com.arjuna.common.util.exceptions.LogConfigurationException: User-specified log class 'com.arjuna.common.internal.util.logging.jakarta.Log4JLogger' cannot be found or is not useable.
                            at com.arjuna.common.internal.util.logging.jakarta.JakartaLogFactory.getLog(JakartaLogFactory.java:96)
                            at com.arjuna.common.util.logging.LogFactory.getLogNoi18n(LogFactory.java:191)
                            at com.arjuna.ats.jta.logging.jtaLogger.<clinit>(jtaLogger.java:57)

                    • 7. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                      yelin666

                      Never mind, got it.

                      • 8. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                        agrawal24_7

                        I am also faceing the same issue. Can you please tell how did u fix it?

                        • 9. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                          yelin666

                          Not sure which particular issue you refered to. Regardless I included the following dependencies in my pom:

                                     

                          <dependency>
                                              <groupId>jboss.jbossts</groupId>
                                              <artifactId>jbossjta</artifactId>
                                              <version>${org.jboss.jta.version}</version>
                                      </dependency>
                                      <dependency>
                                              <groupId>jboss.jbossts</groupId>
                                              <artifactId>jbossts-common</artifactId>
                                              <version>${org.jboss.sts.version}</version>
                                      </dependency>
                                      <dependency>
                                              <groupId>commons-logging</groupId>
                                              <artifactId>commons-logging</artifactId>
                                              <version>${org.jboss.commons.logging.version}</version>
                                      </dependency>

                           

                              <dependency>
                                  <groupId>log4j</groupId>
                                  <artifactId>log4j</artifactId>
                                  <version>${log4j.version}</version>
                              </dependency>      

                           

                          The versions for the above dependencies I was using are:

                                  <org.jboss.commons.logging.version>1.1.0.jboss</org.jboss.commons.logging.version>

                                  <org.jboss.jta.version>4.4.0.GA</org.jboss.jta.version>

                                  <org.jboss.sts.version>4.4.0.GA</org.jboss.sts.version>

                          <log4j.version>1.2.14</log4j.version>
                          • 10. Re: question on using org.infinispan.transaction.lookup.JBossStandaloneJTAManagerLookup
                            agrawal24_7

                            Thanks for the help Lin.

                             

                            Actually the issue was with OSGi plugin frame work and LogManager inplementation from Log4j.

                            It was trying to find com.arjuna.common.internal.util.logging.jakarta.Log4JLogger from the class loader which loaded LogManager while in mycase that transaction apis were loaded in a child class loader (created by OSGi framework). It was resolved once put the jboss transaction manager in the same plugin in which my log4j was.