Getting "IllegalStateException: Cannot set clientID, already set as <client ID>" when subscribing durable JMS Topic from JMS Provider in JBoss ESB

Solution Verified - Updated -

Issue

  • I am using Jboss SOA ESB and trying to connect to a JMS topic in one of the existing remote servers (deployed on different instance of JBoss server).
  • The problem is I can only make a non-durable connection to the foreign JMS Topic; as soon as I try to make it durable by specifying subscriptionName it fails and throws the following exception -
2013-06-05 17:06:47,749 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=jboss.esb.vfsfile:/C:/xxx/jboss-soa-p-5/jboss-as/server/default/deploy/jboss-esb.xml state=Create
org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException: Unexpected JMS error from prepareMessageReceiver
    at org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doInitialise(JmsGatewayListener.java:122)
    at org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle.initialise(AbstractManagedLifecycle.java:133)
    at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.initialiseInstances(ManagedLifecycleController.java:109)
    at org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController.start(ManagedLifecycleController.java:66)
    (snip)
Caused by: javax.jms.IllegalStateException: Cannot set clientID, already set as bbgAimId
    at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.setClientID(ServerConnectionEndpoint.java:316)
    at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$ConnectionAdvised$setClientID$aop(ConnectionAdvised.java:85)
    at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$setClientID_N1479100880614063379.invokeTarget(ConnectionAdvised$setClientID_N1479100880614063379.java)
    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
    at org.jboss.jms.server.container.ServerLogInterceptor.invoke(ServerLogInterceptor.java:105)
    (snip)
  • My JMS-provider in esb config looks like -
<jms-provider connection-factory="XAConnectionFactory"
  jndi-URL="jnp://my-server-a:1099"
  jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
  jndi-pkg-prefix="org.jnp.interfaces" name="MySample JMS Provider">
  <jms-bus busid="MySampleJmsBus">
    <jms-message-filter acknowledge-mode="AUTO_ACKNOWLEDGE"
      dest-name="jms/topic/xxx/MyTopic" dest-type="TOPIC"
      jms-security-credential="xxxxx"
      jms-security-principal="my_jms_user" persistent="true"
      selector="type = 'xxxxx' and transactionReason = 'xxxxx'" transacted="true"/>
  </jms-bus>
</jms-provider>

...
<services>
  <service ...>
    <listeners>
      <jms-listener busidref="MySampleJmsBus"
        clientId="my_sample_client" durableSubscriptionName="my_sample_subscription"
        is-gateway="true" maxThreads="5" name="MySampleJmsListener"/>
    </listeners>
  • I created the JMS user "my_jms_user" with client ID "my_sample_client" directly in the JBM_USER table beforehand for this ESB project's jms-provider configuration.

Environment

  • Red Hat JBoss SOA Platform (SOA-P) 5
  • JBoss Messaging

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content