6 Replies Latest reply on Oct 11, 2005 2:31 AM by umeshs79

    Problem with HAJMS

    robisz

      I have been trying to verify that HAJMS is functioning well...

      I've maked a cluster with two nodes and changed the database
      from hsqldb to Oracle. I've deployed hajms-examples.sar and followed
      the steps as described in this page:

      http://www.jboss.org/wiki/Wiki.jsp?page=JBossMQHA

      Everything seems fine (MasterNode attribute changes correctly),
      but when I run connectPublisher at the last step, I get this in the
      server log:

      2004-10-22 16:08:46,575 INFO [org.jboss.mq.il.ha.examples.HAJMSClient] Connecting
      2004-10-22 16:08:47,013 INFO [org.jboss.mq.il.ha.examples.HAJMSClient] Connected
      2004-10-22 16:08:53,402 INFO [org.jboss.mq.il.ha.examples.HAJMSClient] Registering durable subscriber
      2004-10-22 16:08:53,434 ERROR [org.jboss.web.localhost.Engine] StandardWrapperValve[HtmlAdaptor]:
      Servlet.service() for servlet HtmlAdaptor threw exception
      MBeanException: null Cause: javax.naming.NameNotFoundException: UIL2XAConnectionFactory not bound
       at org.jboss.mx.interceptor.ReflectedDispatcher.handleInvocationExceptions(ReflectedDispatcher.java:166)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:149)
       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:242)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
       at org.jboss.jmx.adaptor.control.Server.invokeOpByName(Server.java:236)
       at org.jboss.jmx.adaptor.control.Server.invokeOp(Server.java:202)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.invokeOp(HtmlAdaptorServlet.java:241)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.processRequest(HtmlAdaptorServlet.java:79)
       at org.jboss.jmx.adaptor.html.HtmlAdaptorServlet.doPost(HtmlAdaptorServlet.java:61)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
       at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
       at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
       at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
       at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: javax.naming.NameNotFoundException: UIL2XAConnectionFactory not bound
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
       at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
       at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
       at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
       at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
       at javax.naming.InitialContext.lookup(InitialContext.java:347)
       at org.jboss.mq.il.ha.examples.HAJMSClient.registerDurableSubscriberAndReceiveMessages(HAJMSClient.java:196)
       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:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       ... 42 more
      2004-10-22 16:49:33,387 INFO [org.jboss.cache.TreeCache] viewAccepted(): new members: [budhcp004139:4198]
      2004-10-22 16:49:36,558 INFO [org.jboss.ha.framework.interfaces.HAPartition.lifecycle.DefaultPartition]
      New cluster view for partition DefaultPartition (id: 2, delta: -1) : [xxx.xxx.xxx.xxx:1099]
      2004-10-22 16:49:40,979 WARN [org.jboss.mq.Connection] Connection failure:
      org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.net.SocketException: Connection reset)
       at org.jboss.mq.Connection.asynchFailure(Connection.java:436)
       at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:400)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: java.net.SocketException: Connection reset
       at java.net.SocketInputStream.read(SocketInputStream.java:168)
       at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
       at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
       at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67)
       at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
       at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313)
       at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380)
       at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452)
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
       ... 1 more
      2004-10-22 16:49:40,979 INFO [org.jboss.mq.il.ha.examples.HAJMSClient] Notification received by ExceptionListener.
      Singleton Probably Moved.
      2004-10-22 16:49:40,979 INFO [org.jboss.mq.il.ha.examples.HAJMSClient] Disconnecting
      2004-10-22 16:49:40,995 INFO [STDOUT] org.jboss.mq.SpyJMSException: Cannot disable the connection with the JMS server;
      - nested throwable: (java.io.IOException: Client is not connected)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.Connection.doStop(Connection.java:1289)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.Connection.close(Connection.java:598)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.ha.examples.HAJMSClient.disconnect(HAJMSClient.java:154)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.ha.examples.HAJMSClient.onException(HAJMSClient.java:56)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.Connection.asynchFailure(Connection.java:446)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:400)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332)
      2004-10-22 16:49:40,995 INFO [STDOUT] at java.lang.Thread.run(Thread.java:534)
      2004-10-22 16:49:40,995 INFO [STDOUT] Caused by: java.io.IOException: Client is not connected
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.java:226)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.SocketManager.sendMessage(SocketManager.java:192)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.il.uil2.UILServerIL.setEnabled(UILServerIL.java:162)
      2004-10-22 16:49:40,995 INFO [STDOUT] at org.jboss.mq.Connection.doStop(Connection.java:1285)
      2004-10-22 16:49:40,995 INFO [STDOUT] ... 8 more


      Thanks for any help

        • 1. Re: Problem with HAJMS

          Is this error only happening on one of the nodes in your cluster or both?

          I've had this problem occur on a node that is not the master node because of an error in setting up the initial context for the queue lookup. Make sure that when you are setting up the Properties to use for your InitialContext, that the ProviderUrl value is the ip's of your cluster, not just localhost:1100. The jndi name UIL2XAConnectionFactory will only be registered on the master node, so if each node is looking to localhost:1100 to find the queue, only the master node will find it.

          Mind you, this is only a problem if the answer to the first question was "only one of the nodes."

          Good luck,

          Tyler

          • 2. Re: Problem with HAJMS
            robisz

            I've tried it with the sample application in JBoss Wiki page...
            I've looked at the source and seen this:

            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");


            Could you show me an example of correct settings?


            • 3. Re: Problem with HAJMS

              Thanks Tyler,

              This worked for me.

              -Umesh

              • 4. Re: Problem with HAJMS
                lordbritish

                How did you run connectPublisher ?

                I'm trying to run the example and I have no clue how to run this connectPublisher().

                I don't even see it in the JMX console. I see HAJMSClient there but not the connectPublisher operation.

                Help me. I'm so confused.

                • 5. Re: Problem with HAJMS
                  lordbritish

                  BTW, I downloaded the hajms-examples.sar example and tried dropping it in the deploy directory and the deploy-hasingleton directory. In either case I could not see this "connectPublisher" operation in the JMX console.

                  I have a feeling i'm doing something really dumb.

                  • 6. Re: Problem with HAJMS

                    Goto to JMX Console and find the HAJMSClient MBean, click on that and you will see all methods of HAJMSClient Mbean from there you can call cconnectPublisher method.

                    here is the url for HaJMSClient Mbean.

                    http://<base url>:/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss.mq.examples%3Aservice%3DHAJMSClient