Skip to main content

EclipseLink CacheCoordination via JMS on GF3.1.1: "Client ID is already in use"

5 replies [Last post]
Henning Verbeek...
Offline
Joined: 2011-10-10

Hi there,

I'm trying to get EclipseLink cache coordination working on a two-instance
GF 3.1.1 cluster. Cache coordination shall be via JMS.

I created the environment like this:
asadmin create-jmsdest --desttype topic --target matchpoint-test
bonusApp.cache
asadmin create-jms-resource --restype javax.jms.ConnectionFactory --target
matchpoint-test --property ClientId=\${AJP_INSTANCE_NAME}
jms/bonusApp/CacheCoordinationFactory
asadmin create-jms-resource --restype javax.jms.Topic --target
matchpoint-test --property Name=bonusApp.cache
jms/bonusApp/CacheCoordinationTopic

Note: ${AJP_INSTANCE_NAME} is different for each cluster instance (it's
basically set to their instance names).

relevant part of persistence.xml:
DISABLE_SELECTIVE

When I access managed entities, I see the following errors in the server
logs of the two instances (karlsruhe-inst1, peine-inst1):

[#|2011-10-06T14:16:08.925+0000|WARNING|glassfish3.1.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=29;_ThreadName=Thread-2;|RAR5117
: Failed to obtain/create connection from connection pool [
jms/bonusApp/CacheCoordinationFactory ]. Reason :
com.sun.appserv.connectors.internal.api.PoolingException:
MQRA:MC:InvalidClientIDException-[C4052]: Client ID is already in use -
karlsruhe-inst1 user=guest, broker=localhost:27676(52058)|#]

[#|2011-10-06T14:16:08.926+0000|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfish3/glassfish/nodes/karlsruhe/karlsruhe-inst1/applications/BonusAppServer/WEB-INF/classes/_bonusAppServerPU|_ThreadID=29;_ThreadName=Thread-2;|Warning:
Dropping remote command connection to Service[EclipseLinkCommandChannel,
4fd7f7db-a231-4e40-bb73-9fa0750590ae, null] on error
com.sun.messaging.jms.JMSException: MQRA:CFA:allocation
failure:createTopicConnection:Error in allocating a connection. Cause:
MQRA:MC:InvalidClientIDException-[C4052]: Client ID is already in use -
karlsruhe-inst1 user=guest, broker=localhost:27676(52058)|#]

(similar for the other instance)

Can you help me find out what's wrong?
Should I maybe not use JMS? Is RMI a better transport mechanism?

Thanks for your help!!

Cheers,
Hank

--
My other signature is a regular expression.
http://www.pray4snow.de

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nigeldeakin
Offline
Joined: 2007-10-12

Henning Verbeek wrote, on 06/10/2011 15:41:
> Hi there,
>
> I'm trying to get EclipseLink cache coordination working on a two-instance GF 3.1.1 cluster. Cache coordination shall
> be via JMS.
> I created the environment like this:
> asadmin create-jmsdest --desttype topic --target matchpoint-test bonusApp.cache
> asadmin create-jms-resource --restype javax.jms.ConnectionFactory --target matchpoint-test --property
> ClientId=\${AJP_INSTANCE_NAME} jms/bonusApp/CacheCoordinationFactory
> asadmin create-jms-resource --restype javax.jms.Topic --target matchpoint-test --property Name=bonusApp.cache
> jms/bonusApp/CacheCoordinationTopic
>
> Note: ${AJP_INSTANCE_NAME} is different for each cluster instance (it's basically set to their instance names).
>
> relevant part of persistence.xml:
> DISABLE_SELECTIVE
>
>
>
>
>
>
>
> When I access managed entities, I see the following errors in the server logs of the two instances (karlsruhe-inst1,
> peine-inst1):
>
> [#|2011-10-06T14:16:08.925+0000|WARNING|glassfish3.1.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors|_ThreadID=29;_ThreadName=Thread-2;|RAR5117
> : Failed to obtain/create connection from connection pool [ jms/bonusApp/CacheCoordinationFactory ]. Reason :
> com.sun.appserv.connectors.internal.api.PoolingException: MQRA:MC:InvalidClientIDException-[C4052]: Client ID is
> already in use - karlsruhe-inst1 user=guest, broker=localhost:27676(52058)|#]
>
> [#|2011-10-06T14:16:08.926+0000|WARNING|glassfish3.1.1|org.eclipse.persistence.session.file:/opt/glassfish3/glassfish/nodes/karlsruhe/karlsruhe-inst1/applications/BonusAppServer/WEB-INF/classes/_bonusAppServerPU|_ThreadID=29;_ThreadName=Thread-2;|Warning:
> Dropping remote command connection to Service[EclipseLinkCommandChannel, 4fd7f7db-a231-4e40-bb73-9fa0750590ae, null]
> on error com.sun.messaging.jms.JMSException: MQRA:CFA:allocation failure:createTopicConnection:Error in allocating a
> connection. Cause: MQRA:MC:InvalidClientIDException-[C4052]: Client ID is already in use - karlsruhe-inst1 user=guest,
> broker=localhost:27676(52058)|#]
>
> (similar for the other instance)
>
> Can you help me find out what's wrong?

I suspect you've run into this issue:
http://java.net/jira/browse/GLASSFISH-6580

I don't think you actually need clientID to be set. Leave it unset, but set the property
useSharedSubscriptionInClusteredContainer to false on the connection factory.

Nigel

hverbeek
Offline
Joined: 2010-04-21

Sorry for not responding earlier, I've been travelling. Thanks for your response, using "useSharedSubscriptionInClusteredContainer = false" on the connection factory resolves the reported issue.

However, now I've run into more confusing problems. During deployment, EclipseLink complains that it cannot find the connection factory due to JNDI Lookup:

Exception [EclipseLink-22106] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not create external JMS connection with Topic jms/bonusAppCacheTopic, Topic Factory jms/bonusAppCacheFactory, and Context properties {java.naming.provider.url=mq://localhost:27676/, java.naming.security.principal=guest, dedicated.connection=true, java.naming.security.credentials=B4279AFEB0CE8B1CBE9319E2F82901C7}
Internal Exception: Exception [EclipseLink-22103] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not look up remote connection under name jms/bonusAppCacheFactory with URL mq://localhost:27676/
Internal Exception: javax.naming.NamingException: Lookup failed for 'jms/bonusAppCacheFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.provider.url=mq://localhost:27676/, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.security.principal=guest, dedicated.connection=true, java.naming.security.credentials=guest} [Root exception is javax.naming.NameNotFoundException: jms]
Command deploy completed with warnings.

The server.log of the DAS shows the full exception:

Caused by: Exception [EclipseLink-22103] (Eclipse Persistence Services - 2.3.0.v20110604-r9504): org.eclipse.persistence.exceptions.RemoteCommandManagerException
Exception Description: Could not look up remote connection under name jms/bonusAppCacheFactory with URL mq://localhost:27676/
Internal Exception: javax.naming.NamingException: Lookup failed for 'jms/bonusAppCacheFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.provider.url=mq://localhost:27676/, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.security.principal=guest, dedicated.connection=true, java.naming.security.credentials=guest} [Root exception is javax.naming.NameNotFoundException: jms]
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.persistence.exceptions.RemoteCommandManagerException.errorLookingUpRemoteConnection(RemoteCommandManagerException.java:101)
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.persistence.sessions.coordination.jms.JMSPublishingTransportManager.getTopicConnectionFactory(JMSPublishingTransportManager.java:184)
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.persistence.sessions.coordination.jms.JMSPublishingTransportManager.createConnection(JMSPublishingTransportManager.java:68)
<span class="Apple-tab-span" style="white-space:pre"> </span>... 45 more

Caused by: javax.naming.NamingException: Lookup failed for 'jms/bonusAppCacheFactory' in SerialContext[myEnv={java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.provider.url=mq://localhost:27676/, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming, java.naming.security.principal=guest, dedicated.connection=true, java.naming.security.credentials=guest} [Root exception is javax.naming.NameNotFoundException: jms]
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:518)
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
<span class="Apple-tab-span" style="white-space:pre"> </span>at javax.naming.InitialContext.lookup(InitialContext.java:392)
<span class="Apple-tab-span" style="white-space:pre"> </span>at javax.naming.InitialContext.lookup(InitialContext.java:392)
<span class="Apple-tab-span" style="white-space:pre"> </span>at org.eclipse.persistence.sessions.coordination.jms.JMSPublishingTransportManager.getTopicConnectionFactory(JMSPublishingTransportManager.java:182)
<span class="Apple-tab-span" style="white-space:pre"> </span>... 46 more

Caused by: javax.naming.NameNotFoundException: jms
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.TransientContext.resolveContext(TransientContext.java:310)
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.TransientContext.lookup(TransientContext.java:218)
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:77)
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:119)
<span class="Apple-tab-span" style="white-space:pre"> </span>at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:505)

Parts of my persistence.xml:

&lt;property name=&quot;eclipselink.cache.coordination.protocol&quot; value=&quot;jms&quot;/&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.naming-service&quot; value=&quot;jndi&quot; /&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jms.host&quot; value=&quot;mq://localhost:27676/&quot;/&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jms.topic&quot; value=&quot;jms/bonusAppCacheTopic&quot;/&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jms.factory&quot; value=&quot;jms/bonusAppCacheFactory&quot;/&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jms.reuse-topic-publisher&quot; value=&quot;true&quot;/&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jndi.user&quot; value=&quot;guest&quot; /&gt;<br />&lt;property name=&quot;eclipselink.cache.coordination.jndi.password&quot; value=&quot;guest&quot; /&gt;

And here's how I created the JMS resources:

asadmin create-jmsdest --desttype topic --target matchpoint-test bonusApp.cache
asadmin create-jms-resource --restype javax.jms.ConnectionFactory --target matchpoint-test --property useSharedSubscriptionInClusteredContainer=false jms/bonusAppCacheFactory
asadmin create-jms-resource --restype javax.jms.Topic --target matchpoint-test --property Name=bonusApp.cache jms/bonusAppCacheTopic<br type="_moz" />

Does anyone have an idea what this could be about?

kytie
Offline
Joined: 2011-11-21

Hi,

I am running into this exact same issue runinng eclipselink on GlassFish 3.1.2, did you ever manage to resolve the issue?

Any help would be much appreciated.

Regards,

Chris Kyte

101000
Offline
Joined: 2011-06-01

Same problem here with 3.1.2.
I resolved assigning JMS connection factory and destination resources targets not only to cluster but also to DAS

nigeldeakin
Offline
Joined: 2007-10-12

This part of the error message caught my eye:

> java.naming.provider.url=mq://localhost:27676/,

mq://localhost:27676 is the URL of your JMS server, not the URL of your JNDI provider.

So there's something wrong with your JNDI settings. (I'm not familiar with EclipseLink so can't advise you how to
configure it).

Nigel