11 Replies Latest reply on Aug 30, 2007 11:55 AM by Brian Stansberry

    Failed to create local transaction; TransactionManager is nu

    Bruce Springfield Apprentice

      JBoss Server 4.2.1, PojoCache version: JBossCache 'Habanero' 2.0.0.CR3

      using as Transaction manager : org.jboss.cache.transaction.JBossTransactionManagerLookup

      cache mode : LOCAL

      cache initialized and started

      on first attach() attempt, got error :

      java.lang.Exception: Failed to create local transaction; TransactionManager is null

      Had been working fine before. Anyone else ever encounter this and know how to fix it?



        • 1. Re: Failed to create local transaction; TransactionManager i
          Bruce Springfield Apprentice

          If I remove the entry :


          org.jboss.cache.transaction.JBossTransactionManagerLookup


          from my cache config .xml file then POJO Cache runs fine

          I get the message :

          No transaction manager lookup class has been defined. Transactions cannot be used

          But otherwise no problems

          • 2. Re: Failed to create local transaction; TransactionManager i
            Bruce Springfield Apprentice

            That's :

            <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.JBossTransactionManagerLookup
             </attribute>


            • 3. Re: Failed to create local transaction; TransactionManager i
              Bruce Springfield Apprentice

              Put the TransactionManagerLookupClass entry back in and it still runs.

              • 4. Re: Failed to create local transaction; TransactionManager i
                Bruce Springfield Apprentice

                add entry to config xml file :

                <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>


                Then error returns. This was one entry I added to the config file before the initial error.

                Is the entry correct?

                Is there any reason the NodeLockingScheme would null out the Transaction Manager?

                • 5. Re: Failed to create local transaction; TransactionManager i
                  Manik Surtani Master

                   

                  "BruceSpringfield" wrote:
                  add entry to config xml file :

                  <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>


                  Then error returns. This was one entry I added to the config file before the initial error.

                  Is the entry correct?

                  Is there any reason the NodeLockingScheme would null out the Transaction Manager?


                  The entry is correct, and there is no reason that the NLS should null out the TM.

                  Any reason why you're using a CR3 instead of the GA, BTW?

                  • 6. Re: Failed to create local transaction; TransactionManager i
                    Bruce Springfield Apprentice

                    Hi Manik,

                    "manik.surtani@jboss.com" wrote:

                    The entry is correct, and there is no reason that the NLS should null out the TM.

                    Any reason why you're using a CR3 instead of the GA, BTW?


                    I have been using CR3 because that was the version available for download, when I downloaded JBossCache. But I will upgrade and check the error again.



                    • 7. Re: Failed to create local transaction; TransactionManager i
                      Bruce Springfield Apprentice

                      upgraded to JBossCache-all-2.0.0.GA

                      same results

                      If

                      <attribute name="NodeLockingScheme">OPTIMISTIC</attribute>
                      


                      is in the config file, I get the following error on start of cache :

                      11:31:07,596 INFO [PojoCacheImpl] PojoCache version: JBossCache 'Habanero' 2.0.0.GA[ $Id: Version.java,v 1.35 2007/08/01 16:52:13 msurtani Exp $]
                      11:31:08,986 ERROR [[Controller]] Servlet.service() for servlet Controller threw exception
                      org.jboss.cache.pojo.PojoCacheException: Failed starting java.lang.RuntimeException: java.lang.Exception: Failed to create local transaction; TransactionManager is null
                      at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:262)
                      at com.jboss.cache.POJOCacheImpl.start(POJOCacheImpl.java:176)
                      at com.jboss.cache.POJOCacheImpl.(POJOCacheImpl.java:39)
                      at com.jboss.cache.POJOCacheImpl.cacheInstance(POJOCacheImpl.java:48)
                      at com.jboss.test.CacheSecondLevelTest.init(CacheSecondLevelTest.java:37)
                      at com.jboss.test.CacheSecondLevelTest.start(CacheSecondLevelTest.java:159)
                      at com.jboss.test.ControllerServlet.processRequest(ControllerServlet.java:45)
                      at com.jboss.test.ControllerServlet.doGet(ControllerServlet.java:19)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      at java.lang.Thread.run(Thread.java:595)
                      Caused by: java.lang.RuntimeException: java.lang.Exception: Failed to create local transaction; TransactionManager is null
                      at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3951)
                      at org.jboss.cache.CacheImpl.get(CacheImpl.java:1441)
                      at org.jboss.cache.CacheImpl.get(CacheImpl.java:1415)
                      at org.jboss.cache.loader.CacheLoaderManager.preload(CacheLoaderManager.java:282)
                      at org.jboss.cache.loader.CacheLoaderManager.preloadCache(CacheLoaderManager.java:256)
                      at org.jboss.cache.CacheImpl.internalStart(CacheImpl.java:796)
                      at org.jboss.cache.CacheImpl.start(CacheImpl.java:708)
                      at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:258)
                      ... 27 more
                      Caused by: java.lang.Exception: Failed to create local transaction; TransactionManager is null
                      at org.jboss.cache.interceptors.TxInterceptor.createLocalTx(TxInterceptor.java:946)
                      at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:288)
                      at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:131)
                      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
                      at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:81)
                      at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
                      at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:62)
                      at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3939)
                      ... 34 more


                      used simple cache config :

                      <?xml version="1.0" encoding="UTF-8" ?>


                      jboss:service=Naming
                      jboss:service=TransactionManager
                      org.jboss.cache.transaction.JBossTransactionManagerLookup
                      LOCAL







                      • 8. Re: Failed to create local transaction; TransactionManager i
                        Bruce Springfield Apprentice

                        used a simple cache config :

                        <?xml version="1.0" encoding="UTF-8"?>
                        <server>
                         <mbean code="org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper"
                         name="jboss.cache:service=PojoCache">
                         <depends>jboss:service=Naming</depends>
                         <depends>jboss:service=TransactionManager</depends>
                         <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.JBossTransactionManagerLookup</attribute>
                         <attribute name="CacheMode">LOCAL</attribute>
                         </mbean>
                        </server>


                        • 9. Re: Failed to create local transaction; TransactionManager i
                          Brian Stansberry Master

                          Suggest you turn on TRACE level logging for org.jboss.cache, start your server, and post the section of the server log where the cache is being created and started.

                          • 10. Re: Failed to create local transaction; TransactionManager i
                            Bruce Springfield Apprentice

                            logging on startup :

                            2007-08-30 15:24:12,800 INFO [STDOUT] - before start
                            2007-08-30 15:24:12,800 INFO [org.jboss.cache.pojo.impl.PojoCacheImpl] PojoCache version: JBossCache 'Habanero' 2.0.0.GA[ $Id: Version.java,v 1.35 2007/08/01 16:52:13 msurtani Exp $]
                            2007-08-30 15:24:12,862 INFO [org.jboss.cache.factories.InterceptorChainFactory] interceptor chain is:
                            class org.jboss.cache.interceptors.CallInterceptor
                            class org.jboss.cache.interceptors.OptimisticNodeInterceptor
                            class org.jboss.cache.interceptors.OptimisticCreateIfNotExistsInterceptor
                            class org.jboss.cache.interceptors.OptimisticValidatorInterceptor
                            class org.jboss.cache.interceptors.OptimisticLockingInterceptor
                            class org.jboss.cache.interceptors.NotificationInterceptor
                            class org.jboss.cache.interceptors.TxInterceptor
                            class org.jboss.cache.interceptors.CacheMgmtInterceptor
                            class org.jboss.cache.interceptors.InvocationContextInterceptor
                            2007-08-30 15:24:12,862 DEBUG [org.jboss.cache.CacheImpl.test-1] Not using an EvictionPolicy
                            2007-08-30 15:24:12,862 INFO [org.jboss.cache.pojo.impl.PojoCacheImpl] PojoCache version: JBossCache 'Habanero' 2.0.0.GA[ $Id: Version.java,v 1.35 2007/08/01 16:52:13 msurtani Exp $]
                            2007-08-30 15:24:12,878 DEBUG [org.jboss.cache.CacheImpl.test-1] failed looking up TransactionManager, will not use transactions
                            java.lang.ClassCastException: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate
                            at org.jboss.cache.transaction.JBossTransactionManagerLookup.getTransactionManager(JBossTransactionManagerLookup.java:20)
                            at org.jboss.cache.CacheImpl.createTransactionManager(CacheImpl.java:660)
                            at org.jboss.cache.CacheImpl.internalStart(CacheImpl.java:726)
                            at org.jboss.cache.CacheImpl.start(CacheImpl.java:708)
                            at org.jboss.cache.pojo.impl.PojoCacheImpl.start(PojoCacheImpl.java:258)
                            at com.jboss.cache.POJOCacheImpl.start(POJOCacheImpl.java:196)
                            at com.jboss.cache.POJOCacheImpl.<init>(POJOCacheImpl.java:40)
                            at com.jboss.cache.POJOCacheImpl.cacheInstance(POJOCacheImpl.java:49)
                            at com.jboss.test.CacheSecondLevelTest.init(CacheSecondLevelTest.java:37)
                            at com.jboss.test.CacheSecondLevelTest.start(CacheSecondLevelTest.java:197)
                            at com.jboss.test.ControllerServlet.processRequest(ControllerServlet.java:45)
                            at com.jboss.test.ControllerServlet.doGet(ControllerServlet.java:19)
                            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                            at java.lang.Thread.run(Thread.java:595)
                            2007-08-30 15:24:12,878 DEBUG [org.jboss.cache.CacheImpl.test-1] cache mode is local, will not create the channel
                            2007-08-30 15:24:12,878 INFO [org.jboss.cache.CacheImpl.test-1] JBoss Cache version: JBossCache 'Habanero' 2.0.0.GA[ $Id: Version.java,v 1.35 2007/08/01 16:52:13 msurtani Exp $]
                            2007-08-30 15:24:12,878 INFO [STDOUT] - after start


                            the local transaction exception occurs as something is attached to the POJO cache :

                            2007-08-30 15:24:12,925 INFO [STDOUT] Cache Put
                            2007-08-30 15:24:12,925 INFO [STDOUT] ---------------------------------------------
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.InvocationContextInterceptor] Invoked on cache instance [null] and InvocationContext [InvocationContext{methodCall=MethodName: _get; MethodIdInteger: 26; Args: (/vespa/customers/54321/a4ej9/98iurp, POJOCache.PojoReference, true)transaction=null, globalTransaction=null, optionOverrides=Option{failSilently=false, cacheModeLocal=false, dataVersion=null, suppressLocking=false, forceDataGravitation=true, skipDataGravitation=false}, originLocal=true, txHasMods=false}]
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.InvocationContextInterceptor] no transaction manager configured, setting tx as null.
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.InvocationContextInterceptor] Setting up transactional context.
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.InvocationContextInterceptor] Setting tx as null and gtx as null
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.TxInterceptor] (null) call on method [MethodName: _get; MethodIdInteger: 26; Args: (/vespa/customers/54321/a4ej9/98iurp, POJOCache.PojoReference, true)]
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.TxInterceptor] Creating transaction for thread Thread[http-127.0.0.1-8080-1,5,jboss]
                            2007-08-30 15:24:12,971 TRACE [org.jboss.cache.interceptors.InvocationContextInterceptor] Resetting invocation-scope options
                            2007-08-30 15:24:12,971 ERROR [com.jboss.cache.POJOCacheImpl] put()
                            java.lang.RuntimeException: java.lang.Exception: Failed to create local transaction; TransactionManager is null
                            at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3951)
                            at org.jboss.cache.CacheImpl.get(CacheImpl.java:1441)
                            at org.jboss.cache.CacheImpl.get(CacheImpl.java:1415)
                            at org.jboss.cache.pojo.impl.InternalHelper.get(InternalHelper.java:92)
                            at org.jboss.cache.pojo.impl.InternalHelper.getPojoReference(InternalHelper.java:46)
                            at org.jboss.cache.pojo.impl.InternalHelper.getPojo(InternalHelper.java:181)
                            at org.jboss.cache.pojo.impl.PojoCacheDelegate.putObjectI(PojoCacheDelegate.java:113)
                            at org.jboss.cache.pojo.impl.PojoCacheImpl.putObject(PojoCacheImpl.java:133)
                            at org.jboss.cache.pojo.impl.PojoCacheImpl.org$jboss$cache$pojo$impl$PojoCacheImpl$attach$aop(PojoCacheImpl.java:101)
                            at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java)
                            at org.jboss.cache.pojo.impl.PojoCacheImpl.attach(PojoCacheImpl.java:93)
                            at com.jboss.cache.POJOCacheImpl.put(POJOCacheImpl.java:62)
                            at com.jboss.test.CacheSecondLevelTest.testSecondLevel(CacheSecondLevelTest.java:88)
                            at com.jboss.test.CacheSecondLevelTest.start(CacheSecondLevelTest.java:199)
                            at com.jboss.test.ControllerServlet.processRequest(ControllerServlet.java:45)
                            at com.jboss.test.ControllerServlet.doGet(ControllerServlet.java:19)
                            at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
                            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                            at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
                            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
                            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
                            at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
                            at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
                            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
                            at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
                            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
                            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
                            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
                            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                            at java.lang.Thread.run(Thread.java:595)
                            Caused by: java.lang.Exception: Failed to create local transaction; TransactionManager is null
                            at org.jboss.cache.interceptors.TxInterceptor.createLocalTx(TxInterceptor.java:946)
                            at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:288)
                            at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:131)
                            at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
                            at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:81)
                            at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:76)
                            at org.jboss.cache.interceptors.InvocationContextInterceptor.invoke(InvocationContextInterceptor.java:62)
                            at org.jboss.cache.CacheImpl.invokeMethod(CacheImpl.java:3939)
                            ... 35 more


                            • 11. Re: Failed to create local transaction; TransactionManager i
                              Brian Stansberry Master

                              The issue is the ClassCastException logged at DEBUG. (Tangent -- I'd thought in 2.0 we were going to fail start if this kind of thing occurred; seems we didn't.)

                              I can reproduce this on an AS 4.2.x build. Works fine on an trunk (AS 5) build.

                              Only thing I can think of is an incompatibility in the javax.transaction.TransactionManager class between the two (AS 5 is JEE 5 based; 4.x is J2EE 1.4). That doesn't really jive with my understanding of how dynamic binding in Java works, though.

                              All I can suggest as a shot in the dark is to check out the source for JBC 2.0.0.GA, replace the jboss-j2ee.jar in the lib dir with the one from your JBoss AS' server/all/lib dir, rebuild JBC and see if that solves the problem.