11 Replies Latest reply on Mar 30, 2007 11:13 AM by mskonda

    Re: Delaying recovery upon server startup

      How do I delay recovery?

      The reason I want the delay is - the recovery manager will get a reference to the XAResource (messaging xa resource) and obviously it can't find the resource as the applicaiton server and it's messaging provider are not fully initialized.

      see below stack trace:

      6:07:03,164 INFO [loggerI18N] [com.arjuna.ats.internal.jta.recovery.info.loading] Local XARecoveryModule loading org.jboss.jms.recovery.MessagingXAResourceRecoveryDefaultJMSProvider
      16:07:03,171 ERROR [MessagingXAResourceRecovery] Failed to look up provider adaptor
      javax.naming.NameNotFoundException: DefaultJMSProvider not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
       at javax.naming.InitialContext.lookup(InitialContext.java:351)
       at org.jboss.jms.recovery.MessagingXAResourceRecovery.initialise(MessagingXAResourceRecovery.java:102)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.<init>(XARecoveryModule.java:356)
       at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.<init>(XARecoveryModule.java:76)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
       at java.lang.Class.newInstance0(Class.java:350)
       at java.lang.Class.newInstance(Class.java:303)
       at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.loadModule(PeriodicRecovery.java:355)
       at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.loadModules(PeriodicRecovery.java:324)
       at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.<init>(PeriodicRecovery.java:85)
       at com.arjuna.ats.internal.arjuna.recovery.RecoveryManagerImple.<init>(RecoveryManagerImple.java:128)
       at com.arjuna.ats.arjuna.recovery.RecoveryManager.<init>(RecoveryManager.java:255)
       at com.arjuna.ats.arjuna.recovery.RecoveryManager.manager(RecoveryManager.java:121)
       at com.arjuna.ats.arjuna.recovery.RecoveryManager.manager(RecoveryManager.java:102)
       at com.arjuna.ats.jbossatx.jta.TransactionManagerService.startService(TransactionManagerService.java:140)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
       at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
       at $Proxy0.start(Unknown Source)
       at org.jboss.system.ServiceController.start(ServiceController.java:417)
       at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy4.start(Unknown Source)
       at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
       at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
       at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
       at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
       at $Proxy5.deploy(Unknown Source)
       at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
       at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
       at org.jboss.Main.boot(Main.java:200)
       at org.jboss.Main$1.run(Main.java:490)
       at java.lang.Thread.run(Thread.java:595)
      


      Tim was suggesting that there is a config attribute that I can use to delay the scanning for xa resoruces by RM.

      Thanks
      Madhu

        • 1. Re: Re: Delaying recovery upon server startup
          kconner

          Madhu, which version are you using?

          The recovery should not start until the app server has sent the start notification.

          • 2. Re: Delaying recovery upon server startup

            Kevin, I'm using 4.2.2 (latest) with JBoss 4.0.5.GA and JBM 1.2.0.GA

            • 3. Re: Re: Delaying recovery upon server startup
              kconner

              Hiya Madhu.

              This appears to be an issue with the initialisation of the messaging resource recovery module. Let me check up on this and get back to you.

              P.S. The version you have does defer the execution of the recovery manager until the server is started but unfortunately not the configuration.

              • 4. Re: Delaying recovery upon server startup

                Kevin, any progress on this issue?

                • 5. Re: Re: Delaying recovery upon server startup
                  kconner

                  Sorry Madhu, not yet. It will be sometime this afternoon when I get a chance to look at it.

                  BTW I am in the same timezone.

                  • 6. Re: Delaying recovery upon server startup

                    Kevin, didn't want to pester you too much on this, but any updates?

                    Thanks
                    Madhu

                    • 7. Re: Re: Delaying recovery upon server startup
                      kconner

                      Hiya Madhu.

                      Apologies, I was pulled off onto something else. I am looking at it now.

                      Kev

                      P.S. Please feel free to pester any time :-)

                      • 8. Re: Re: Delaying recovery upon server startup
                        kconner

                        Hiya Madhu.

                        Getting this configured is fairly straight forward but, by default, messaging is scoped on 4.0.5. You have obviously changed your deployment so that this is no longer an issue but I am not sure what the implications of this will be.

                        I added the following entry into jbossjta-properties.xml

                        <property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.messaging"
                         value="org.jboss.jms.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>
                        

                        changed the jboss-service.xml to the following
                        <mbean code="org.jboss.jms.jndi.JMSProviderLoader"
                         name="jboss.messaging:service=JMSProviderLoader,name=JMSProvider">
                         <attribute name="ProviderName">DefaultJMSProvider</attribute>
                         <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
                         <attribute name="FactoryRef">java:/NonClusteredXAConnectionFactory</attribute>
                         <attribute name="QueueFactoryRef">java:/NonClusteredXAConnectionFactory</attribute>
                         <attribute name="TopicFactoryRef">java:/NonClusteredXAConnectionFactory</attribute>
                        </mbean>
                        
                        <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
                         name="jboss:service=TransactionManager">
                         <attribute name="TransactionTimeout">300</attribute>
                         <depends>jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
                        </mbean>

                        Then commented out the JMSProvider definition from jms-ds.xml.

                        My only concern is the scoping normally required by messaging and whether removing this would have an effect on something else.

                        • 9. Re: Delaying recovery upon server startup

                          Hello Kevin,

                          Making TS depending on the Provider worked!

                          However, I didn't uncomment the provider def in the jms-ds.xml. I also didn't add that def in jboss-service.xml but simply enabled the dependency of TS on JMSProvider bean

                          <!-- JBossJTA -->
                           <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
                           name="jboss:service=TransactionManager">
                           <attribute name="TransactionTimeout">300</attribute>
                           <depends>jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
                           </mbean>
                          


                          This did the trick!

                          Thanks a ton for your input
                          /Madhu

                          • 10. Re: Re: Delaying recovery upon server startup
                            kconner

                            Hiya Madhu.

                            Please make the other changes as well. If you do not do this then JBossTS will not be running until after jboss-messaging has been deployed by which time the other subsystems may have already defaulted to JBossTM.

                            • 11. Re: Delaying recovery upon server startup

                              Okay Kevin, I'll go with you.

                              Thanks
                              Madhu