Skip to main content

JMSException on createConnection=[C4052]: Client ID is already in use

Please note these forums are being decommissioned and use the new and improved forums at
No replies
Joined: 2011-03-01


My environment is glassfish 3.1.2 & Java 1.7.

I cannot understand why i systematically get an exception on createTopicConnection() about Client ID already in use. I have no other client already registered and connected to my topic.
This subscriber is outside of the container, so i cannot use MDB model.

In the glassfish-resource.xml I added the clientId resource, and here is my code.

// get the initial context
InitialContext ctx = new InitialContext();
// lookup the topic object
topic = (Topic) JmsManager.jndiLookup("jms/MyQueue");
// lookup the topic connection factory
topicConnectionFactory = (TopicConnectionFactory) JmsManager.jndiLookup("jms/MyFactory");
// create a topic connection
topicConnection = topicConnectionFactory.createTopicConnection();

Any idea is welcome.