4 Replies Latest reply on Jun 30, 2004 3:26 PM by ovidiu.feodorov

    3.2.4 or 3.2.5 HAJMS failover problems

    wangchen_ca

      My problem is the faliover does not work. Hope somebody can give me some help. Thanks advanced.

      I follow the http://www.jboss.org/wiki/wiki.jsp?page=JBossMQHA, set JMS to MySql. Only difference between what I do and the guide says is I use MySqlDS as datasource name, whereas the guide use DefaultDS.

      I have two jboss 3.2.4(5) with same configuration set, and I start them one by one; it's fine. Then I deploy my stuff ( some sessionBeans or Mbeans use a HAJMSSender or Receiver sending/receiving objs to queues and some MDBeans consuming them) to farm; they works fine. for my code, I use the HAJNDI, localhost:1100 and XAConnectionFactory.

      The problems comes when I shutdown one jboss. It seems the JMS client can not find XAConnectonFactory any more. I stop there.

      Then I try to deploy the hajms-examples.sar.zip and load-balanced-mdbs-example.zip of the guide to find some clue, but I fail. First, the hajms-examples(JMSClient) even can't be deployed ( I post the problem into the forum yesterday, you can see some detail there). Second, the load-balanced-MDB cause a lot problems at deploying time. I suspect the two examples. Are tye really for the two final release?

      My questiones:

      1. What datasource name do you use? DefaultDS or MySqlDS? I feel it does not matter?
      2. Did you tried the two examples? How to make them work?
      3. Can you give me some suggestion?

      Thanks.

      Charles

        • 1. Problem starting w/ JBoss 4.0.1 + JDK 1.5.0_01 + EJB 3.0 Pre
          ovidiu.feodorov

          I'm running JBoss 4.0.1, JDK 1.5.0_01, and EJB 3.0 Preview 2.

          The only modifications made were the copying of the EJB 3.0 lib files (ejb3.deployer and ejb3-interceptors-aop.xml) to the server\all\deploy directory.

          Upon starting JBoss the following stacktrace is thrown:

          2004-12-30 15:15:43,390 WARN [org.jboss.system.ServiceController] Problem starting service jboss.ejb3:service=EJB3Deployer
          java.lang.NoSuchMethodError: org.jboss.deployment.MainDeployerMBean.setSuffixOrder([Ljava/lang/String;)V
          at org.jboss.ejb3.EJB3Deployer.startService(EJB3Deployer.java:90)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
          at sun.reflect.GeneratedMethodAccessor2.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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:416)
          at org.jboss.system.ServiceController.start(ServiceController.java:438)
          at sun.reflect.GeneratedMethodAccessor9.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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy4.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
          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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy8.deploy(Unknown Source)
          at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
          at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
          at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
          at sun.reflect.GeneratedMethodAccessor2.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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
          at $Proxy0.start(Unknown Source)
          at org.jboss.system.ServiceController.start(ServiceController.java:416)
          at sun.reflect.GeneratedMethodAccessor9.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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy4.start(Unknown Source)
          at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
          at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
          at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
          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:144)
          at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
          at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
          at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
          at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
          at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
          at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
          at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
          at $Proxy5.deploy(Unknown Source)
          at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
          at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
          at org.jboss.Main.boot(Main.java:162)
          at org.jboss.Main$1.run(Main.java:423)
          at java.lang.Thread.run(Thread.java:595

          NOTE: I downgraded to the JBoss 4.0.1 RC 1 binary and startup went smoothly

          • 2. Re: 3.2.4 or 3.2.5 HAJMS failover problems

            The datasource is irrevelent.

            You need to look at the clustering.
            When the jms node dies, another node should become the jms node.

            Specifically, look at what is happening to
            jboss.ha:service=HASingletonDeployer
            on each node.

            You may need to look at DEBUG or TRACE messages.

            You can also list cluster events from the Cluster/DefaultPartition mbean
            on the jmx-console.

            • 3. Re: 3.2.4 or 3.2.5 HAJMS failover problems
              miguelangelomoutinho

              I'm having the same problem and I'd like to help here.
              Looking at HASingleton, I've realised that the second node become the master one. Topics and queues have been "passed" to the second node as the node actually detected the failover.
              But the problem starts at this point. It keeps on trying to connect to JMS and failing. I don't know where to look for!

              10:28:03,623 WARN [Connection] Connection failure:
              org.jboss.mq.SpyJMSException: Connection Failed; - nested throwable: (java.io.IOException: ping timeout.)
               at org.jboss.mq.Connection.asynchFailure(Connection.java:429)
               at org.jboss.mq.Connection$PingTask.run(Connection.java:1378)
               at EDU.oswego.cs.dl.util.concurrent.ClockDaemon$RunLoop.run(ClockDaemon.java:364)
               at java.lang.Thread.run(Unknown Source)
              Caused by: java.io.IOException: ping timeout.
               at org.jboss.mq.Connection$PingTask.run(Connection.java:1370)
               ... 2 more


              • 4. Re: 3.2.4 or 3.2.5 HAJMS failover problems
                kallu_27

                I was also getting errors while deploying hajms-examples.sar.zip on jboss 3.2.6 and here is what i found.
                In the HAJMSClient.java only the method connectPublisher uses the right jndi properties .

                 Properties p = new Properties();
                 p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
                 p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
                 p.put(Context.PROVIDER_URL, "localhost:1100"); // HA-JNDI port.
                 InitialContext iniCtx = new InitialContext(p);
                
                 Object tmpConnFactory = iniCtx.lookup("XAConnectionFactory");
                

                And the other methods registerDurableSubscriberAndDisconnect() and
                registerDurableSubscriberAndReceiveMessages() dont use these properties but use the default.
                 InitialContext iniCtx = new InitialContext();
                 Object tmp = iniCtx.lookup("UIL2XAConnectionFactory");
                

                So if i deploy HAJMS examples on node1 and node1 is the Master and then i stop the HASingletonController on node1 and try to run
                registerDurableSubscriberAndReceiveMessages
                I get the following error. UILX2ConnectionFactory not bound.

                After changing the HAJMSClient.java to make other methods also use the same InitialContext as connectPublisher,the example is working fine.

                I think the cause of the error was HAJMSClient looking up local JNDI instead of HAJNDI.

                Is this a bug in the HAJMSClient.java or am I missing something?

                Thanks,
                Kalyan