Thursday, September 22, 2011

weblogic.jms.common.InvalidClientIDException

This is what you get when you try to create 2 TopicConnection with the same ClientID:


Exception in thread "main" weblogic.jms.common.InvalidClientIDException: Client id, PVTEST_ID, is in use. The reason for rejection is "The JNDI name weblogic.jms.connection.clientid.PVTEST_ID was found, and was bound to an object of type weblogic.jms.frontend.FEClientIDSingularAggregatable : FEClientIDSingularAggregatable(SingularAggregatable(<3366864250607130900.1>:672):PVTEST_ID)"


at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:45)
at weblogic.jms.client.JMSConnection.setClientID(JMSConnection.java:632)
at weblogic.jms.client.WLConnectionImpl.setClientID(WLConnectionImpl.java:602)
at durablesubscribers.Main.main(Main.java:46)

This is the offending code, at line 46:

TopicConnectionFactory qcf = (TopicConnectionFactory) ctx.lookup( "cf.epos.ho.01.nonXA.01" );
System.out.println("createTopicConnection");
topicConnection = qcf.createTopicConnection();
// must specify, otherwise you get an IllegalStateException
topicConnection.setClientID("PVTEST_ID");


No comments: