Hi!
I am migrating an EJB2.1 application from OC4J to Glassfish4 and have some issues with a durable subscription.
OC4J did not need a clientId for durable subscriptions, but Glassfish seems to do that.
Created topic:
asadmin create-jms-resource --restype=javax.jms.Topic --description="Topic for EventObjectMessage(s)" --property Name=PhysicalTopic jms/EventObjectMessageTopic
created topic factory:
asadmin create-jms-resource --restype=javax.jms.TopicConnectionFactory --description="Topic factory" --property ClientId=EventObjectMessageTopicConnectionFactoryID EventObjectMessageTopicConnectionFactory
created physical destination:
asadmin create-jmsdest --desttype topic EventObjectMessageTopic
and glassfish-ejb-jar.xml
This is part of the stacktrace:
[2014-01-07T08:44:44.308+0100] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=46 _ThreadName=admin-listener(3)] [timeMillis: 1389080684308] [levelValue: 1000] [[
Exception during lifecycle processing
java.lang.RuntimeException: EJB Container initialization error
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:291)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:99)
...
Caused by: java.lang.Exception
at com.sun.enterprise.connectors.inbound.ConnectorMessageBeanClient.setup(ConnectorMessageBeanClient.java:216)
at org.glassfish.ejb.mdb.MessageBeanContainer.
at org.glassfish.ejb.mdb.MessageBeanContainerFactory.createContainer(MessageBeanContainerFactory.java:63)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:221)
... 68 more
Caused by: javax.resource.NotSupportedException: MQRA:EC:Error creating Direct Message Consumer:
createConsumer on JMSService:jmsdirect failed for connectionId:8664718337762585088 and sessionId:8664718337762587904 due to [B4135]: Cannot add durable consumer MyObserver. No ClientID was set on connection.
at com.sun.messaging.jms.ra.EndpointConsumer.createDirectMessageConsumer(EndpointConsumer.java:890)
at com.sun.messaging.jms.ra.EndpointConsumer._init(EndpointConsumer.java:345)
I am not sure if clientId should only be set on the connectionfactory and as a mdb-resource-adapter as I did.
Does anyone have a tip or could point out what i miss.
Best regards Geir