13 Replies Latest reply on Feb 21, 2007 10:35 AM by sathish_06

    Getting javax.jms.InvalidClientIDException when using 1.0.1.

    sathish_06

      Hi,
      Iam trying to use the Jboss Messaging System-1.0.1.SP4, which got released recently, but its throwing exception message "javax.jms.InvalidClientIDException: Client ID 'defaultclient' already used by ConnectionEndpoint[-2147483632]"

      Here is the configuration settings related to client ID in the persistence DB(oracle):

      SELECT * FROM jms_user;
      
      USERID PASSWD CLIENTID
      mqm mqm defaultclient
      guest guest testclient


      Note: We don't user user id - guest(client id - 'testclient'). We only uses userid - mqm.

      And, we configured multiple destination(Topics) with single role/userid(mqm) in the destinations-service.xml file as shown below,

      c:\jboss-4.0.4.GA\server\messaging\deploy\jboss-messaging.sar\destinations-service.xml
      
      <?xml version="1.0" encoding="UTF-8"?>
      <server>
      
       <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=HelloWorldTopic" xmbean-dd="xmdesc/Topic-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <attribute name="JNDIName">HelloWorldTopic</attribute>
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
      
      
       <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=UserDrivenCategorizationTopic" xmbean-dd="xmdesc/Topic-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <attribute name="JNDIName">UserDrivenCategorizationTopic</attribute>
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
      
       <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=TransactionCategorisationTopic" xmbean-dd="xmdesc/Topic-xmbean.xml">
       <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       <attribute name="JNDIName">TransactionCategorisationTopic</attribute>
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
       ........................
       ........................
      
      </server>



      When we start JBoss Messaging system with the above configuration, it throwing below exception message:-

      02:08:31,248 INFO [JMSContainerInvoker] Waiting for reconnect internal 10000ms for TransactionCategorisationMDB
      02:08:31,279 ERROR [ExceptionUtil] org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint@b4dcd9 createConnectionDelega
      te [5c4o5s4p-gy8nr8-eyddak01-1-eyddfey7-1n]
      javax.jms.InvalidClientIDException: Client ID 'defaultclient' already used by ConnectionEndpoint[-2147483632]
       at org.jboss.jms.server.ServerPeer.checkClientID(ServerPeer.java:651)
       at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpo
      int.java:129)
       at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFact
      oryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:64)
       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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.jms.server.container.InjectionAspect.handleCreateConnectionDelegate(InjectionAspect.java:69)
       at org.jboss.aop.advice.org.jboss.jms.server.container.InjectionAspect0.invoke(InjectionAspect0.java)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
       at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
       at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:715)
       at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:552)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:377)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
      02:08:31,279 ERROR [ServerThread] SocketServerInvoker[0.0.0.0:4457].invoke() call failed: Client ID 'perusworld' already used
      by ConnectionEndpoint[-2147483632]
      02:08:31,295 WARN [JMSContainerInvoker] JMS provider failure detected for DataPointManagementMDB
      javax.jms.InvalidClientIDException: Client ID 'defaultclient' already used by ConnectionEndpoint[-2147483632]
       at org.jboss.jms.server.ServerPeer.checkClientID(ServerPeer.java:651)
       at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpo
      int.java:129)
       at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFact
      oryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:64)
       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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
       at org.jboss.jms.server.container.InjectionAspect.handleCreateConnectionDelegate(InjectionAspect.java:69)
       at org.jboss.aop.advice.org.jboss.jms.server.container.InjectionAspect0.invoke(InjectionAspect0.java)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
       at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101

      Note: When I use 1.0.1.SP2 version, with the above configuration, not facing this problem.

      I just searched this error msg in the jboss site, the url -
      http://lists.jboss.org/pipermail/jboss-cvs-commits/2007-February/021585.html , says that there is a fix made in 1.0.1.SP4, which avoids multiple Client IDs( as per JMS 1.1 spec).

      Here is the snippet of the msg, mentioned in the above web url,

      In ServerConnectionEndpoint.java file
      
      "
      + // verify the clientID is unique
      +
      + // JMS 1.1 Specifications, Section 4.3.2:
      + // "By definition, the client state identified by a client identifier can be ?in use? by
      + // only one client at a time. A JMS provider must prevent concurrently executing clients
      + // from using it."
      "


      Iam not sure how we need to define the client ids/role. Can some one explan on this.

      Do I need to define separate role(username, passwd and client id) for each destinations(Topics) as,

      USERID PASSWD CLIENTID
      mqm1 mqm1 defaultclient1
      mqm2 mqm2 defaultclient2
      mqm3 mqm3 defaultclient3
      mqm4 mqm4 defaultclient4


      and map them in destinations-service.xml as ,

      <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=Topic1"
       xmbean-dd="xmdesc/Topic-xmbean.xml">
       ........
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm1" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
      
      <mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=Topic2"
       xmbean-dd="xmdesc/Topic-xmbean.xml">
       ........
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm2" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>
      mbean code="org.jboss.jms.server.destination.Topic"
       name="jboss.messaging.destination:service=Topic,name=Topic3"
       xmbean-dd="xmdesc/Topic-xmbean.xml">
       ........
       <attribute name="SecurityConfig">
       <security>
       <role name="mqm3" read="true" write="true" create="true"/>
       </security>
       </attribute>
       </mbean>



      Is my understanding correct ?
      Please help me in defining the client ids correctly to use 1.0.1.SP4.

      Thx, Sathish

        • 1. Re: Getting javax.jms.InvalidClientIDException when using 1.
          sathish_06

          And the jms_role table contains following data:-

          SELECT * FROM jms_role
          ROLEID USERID
          guest guest
          mqm mqm


          • 2. Re: Getting javax.jms.InvalidClientIDException when using 1.
            ovidiu.feodorov

            What EJB container version do you use (JBoss AS version)?

            What is "perusworld"? Where does this ID come from?

            • 3. Re: Getting javax.jms.InvalidClientIDException when using 1.
              sathish_06

              Hi,

              The jboss application server that we use is Jboss-4.0.4.GA AS.

              We use 'perusworld' as a client ID. But, while posting to this forum, I had replaced with 'defaultclient' for ease of understanding for everyone.

              Here is the correct one:

              02:08:31,248 INFO [JMSContainerInvoker] Waiting for reconnect internal 10000ms for TransactionCategorisationMDB
              02:08:31,279 ERROR [ExceptionUtil] org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint@b4dcd9 createConnectionDelega
              te [5c4o5s4p-gy8nr8-eyddak01-1-eyddfey7-1n]
              javax.jms.InvalidClientIDException: Client ID 'defaultclient' already used by ConnectionEndpoint[-2147483632]
               at org.jboss.jms.server.ServerPeer.checkClientID(ServerPeer.java:651)
               at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpo
              int.java:129)
               at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFact
              oryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:64)
               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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
               at org.jboss.jms.server.container.InjectionAspect.handleCreateConnectionDelegate(InjectionAspect.java:69)
               at org.jboss.aop.advice.org.jboss.jms.server.container.InjectionAspect0.invoke(InjectionAspect0.java)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
               at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
               at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
               at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:715)
               at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:552)
               at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:377)
               at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
              02:08:31,279 ERROR [ServerThread] SocketServerInvoker[0.0.0.0:4457].invoke() call failed: Client ID 'defaultclient' already used
              by ConnectionEndpoint[-2147483632]
              02:08:31,295 WARN [JMSContainerInvoker] JMS provider failure detected for DataPointManagementMDB
              javax.jms.InvalidClientIDException: Client ID 'defaultclient' already used by ConnectionEndpoint[-2147483632]
               at org.jboss.jms.server.ServerPeer.checkClientID(ServerPeer.java:651)
               at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpo
              int.java:129)
               at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFact
              oryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:64)
               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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
               at org.jboss.jms.server.container.InjectionAspect.handleCreateConnectionDelegate(InjectionAspect.java:69)
               at org.jboss.aop.advice.org.jboss.jms.server.container.InjectionAspect0.invoke(InjectionAspect0.java)
               at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
               at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
               at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101




              Thx, Sathish

              • 4. Re: Getting javax.jms.InvalidClientIDException when using 1.
                ovidiu.feodorov

                Why did you insert a 'defaultclient' client ID in JMS_USER?

                • 5. Re: Getting javax.jms.InvalidClientIDException when using 1.
                  sathish_06

                  Just want to give one update:

                  We tried to setup with different roles(user id & client id) for each destinations(Topic), but still facing the same problem.
                  We suspect that anyother settings other than this needs to be configured roperly.
                  Has anyone faced this kind of problem ? Can you pls guide us what needs to configure to fix this problem.

                  Thx, Sathish

                  • 6. Re: Getting javax.jms.InvalidClientIDException when using 1.
                    ovidiu.feodorov

                    Just get rid of "defaultclient" from JMS_USER and try again.

                    • 7. Re: Getting javax.jms.InvalidClientIDException when using 1.
                      sathish_06

                      Do you mean, set CLIENTID to null in JMS_USER table ?

                      • 8. Re: Getting javax.jms.InvalidClientIDException when using 1.
                        ovidiu.feodorov

                        yes

                        • 9. Re: Getting javax.jms.InvalidClientIDException when using 1.
                          sathish_06

                          Hi Ovidiu,

                          After setting CLIENTID to null in JMS_USER table, now its giving error msg - "Cannot create durable subscriber without a valid client ID"

                          Here is the complete exception stack trace:-

                          23:50:38,276 INFO [EjbModule] Deploying MigrationManagerMDB
                          23:50:41,995 ERROR [ExceptionUtil] SessionEndpoint[-2147483630] createConsumerDelegate [5c4o5s4p-1pplvj-eyens72c-1-eyeny0zv-i]
                          
                          javax.jms.JMSException: Cannot create durable subscriber without a valid client ID
                           at org.jboss.jms.server.endpoint.ServerSessionEndpoint.createConsumerDelegate(ServerSessionEndpoint.java:191)
                           at org.jboss.jms.server.endpoint.advised.SessionAdvised.org$jboss$jms$server$endpoint$advised$SessionAdvised$createCon
                          sumerDelegate$aop(SessionAdvised.java:90)
                           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.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
                           at org.jboss.jms.server.container.SecurityAspect.handleCreateConsumerDelegate(SecurityAspect.java:118)
                           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.aop.advice.PerInstanceAdvice.invoke(PerInstanceAdvice.java:130)
                           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                           at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
                           at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
                           at org.jboss.aop.Advisor.dynamicInvoke(Advisor.java:723)
                           at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:101)
                           at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:127)
                           at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:715)
                           at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:552)
                           at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:377)
                           at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:159)
                          23:50:41,995 ERROR [ServerThread] SocketServerInvoker[0.0.0.0:4457].invoke() call failed: Cannot create durable subscriber wit
                          hout a valid client ID
                          23:50:42,042 WARN [JMSContainerInvoker] JMS provider failure detected for BankAccountHistoryMDB
                          org.jboss.deployment.DeploymentException: Error during topic setup; - nested throwable: (javax.jms.JMSException: Cannot create
                           durable subscriber without a valid client ID)
                           at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
                           at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerStartDelivery(JMSContainerInvoker.java:720)
                           at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:839)
                           at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                           at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                           at sun.reflect.GeneratedMethodAccessor84.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)



                          The SP4 release notes mentioned about following bug,
                          JBMESSAGING-791] - Duplicates clientIDs are not throwing InvalidClientIDException

                          Do we need to make anykind of configuration changes while using this SP4 ? Can you suggest us the ideal way of configuring clientids, roles in JMS_USER, JMS_ROLE and mapping them with desitnations(Topics) .

                          Thx, Sathish

                          • 10. Re: Getting javax.jms.InvalidClientIDException when using 1.
                            timfox

                            You specify the client id in the MDB config

                            • 11. Re: Getting javax.jms.InvalidClientIDException when using 1.
                              timfox

                              e.g.

                               <message-driven>
                               <ejb-name>DurableTopicBean</ejb-name>
                               <configuration-name>Standard Message Driven Bean</configuration-name>
                               <destination-jndi-name>topic/testDurableTopic</destination-jndi-name>
                               <mdb-user>john</mdb-user>
                               <mdb-passwd>needle</mdb-passwd>
                               <mdb-client-id>DurableSubscriberExample</mdb-client-id>
                               </message-driven>
                              


                              • 12. Re: Getting javax.jms.InvalidClientIDException when using 1.
                                timfox

                                There's loads of stuff on the wiki about this.

                                • 13. Re: Getting javax.jms.InvalidClientIDException when using 1.
                                  sathish_06

                                  Hi Tim & Ovidiu,

                                  We configured client ids in the MDB config files, and able to start the system successfully.

                                  Thank you for providing quick replies for fixing the problem :)


                                  Thx, Sathish