JBoss SOA-P throws javax.jms.JMSException: MQJCA1018:Only one session per connection allowed.
Environment
- JBoss Enterprise SOA Platform (SOA-P)
- 4.3.0.GA upto CP02
- Websphere MQ version 6.0.x
Issue
- We already have proxy Queues created for WSMQ using AdminObject in JBoss. We are using them with SOA-P.
- When posting message to the queue we get:
DEBUG [org.jboss.soa.esb.client.ServiceInvoker] Caught service lookup exception for EPR [JMSEpr...
org.jboss.soa.esb.couriers.CourierServiceBindException: Failed to get JMS Session from pool.
at org.jboss.internal.soa.esb.couriers.JmsCourier.getJmsSession(JmsCourier.java:163)
at org.jboss.internal.soa.esb.couriers.JmsCourier.createMessageProducer(JmsCourier.java:383)
at org.jboss.internal.soa.esb.couriers.JmsCourier.internalDeliver(JmsCourier.java:209)
at org.jboss.internal.soa.esb.couriers.JmsCourier.deliver(JmsCourier.java:181)
at org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl.deliver(TwoWayCourierImpl.java:189)
at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.attemptDelivery(ServiceInvoker.java:576)
at org.jboss.soa.esb.client.ServiceInvoker$EPRInvoker.access$200(ServiceInvoker.java:493)
at org.jboss.soa.esb.client.ServiceInvoker.post(ServiceInvoker.java:343)
at org.jboss.soa.esb.client.ServiceInvoker.deliverAsync(ServiceInvoker.java:233)
at org.jboss.soa.esb.listeners.gateway.JmsGatewayListener.doRun(JmsGatewayListener.java:176)
at org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle.run(AbstractThreadedManagedLifecycle.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.jms.JMSException: MQJCA1018:Only one session per connection allowed.
at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:115)
at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:80)
at com.ibm.mq.connector.outbound.ConnectionWrapper.createSession(ConnectionWrapper.java:101)
at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool$JmsSessionPool$2.call(JmsConnectionPool.java:817)
at org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool$JmsSessionPool$2.call(JmsConnectionPool.java:809)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
... 1 more
INFO [org.jboss.soa.esb.client.ServiceInvoker] Unresponsive EPR:
JMSEpr [ PortReference < <wsa:Address jms:127.0.0.1:1099#jbossESB.QUEUE/>,
<wsa:ReferenceProperties jbossesb:java.naming.factory.initial : org.jnp.interfaces.NamingContextFactory/>,
<wsa:ReferenceProperties jbossesb:java.naming.provider.url : 127.0.0.1:1099/>,
<wsa:ReferenceProperties jbossesb:java.naming.factory.url.pkgs : org.jnp.interfaces/>,
<wsa:ReferenceProperties jbossesb:destination-type : queue/>,
<wsa:ReferenceProperties jbossesb:destination-name : jbossESB.QUEUE/>,
<wsa:ReferenceProperties jbossesb:specification-version : 1.1/>,
<wsa:ReferenceProperties jbossesb:connection-factory : WSMQConnectionFactory/>,
<wsa:ReferenceProperties jbossesb:persistent : true/>,
<wsa:ReferenceProperties jbossesb:acknowledge-mode : AUTO_ACKNOWLEDGE/>,
<wsa:ReferenceProperties jbossesb:transacted : false/>,
<wsa:ReferenceProperties jbossesb:type : urn:jboss/esb/epr/type/jms/> > ]
for message: header: [ ]
INFO [org.jboss.soa.esb.client.ServiceInvoker] Delivering message [header: [ ]] to RDLVRQ.
Resolution
Make sure the jms-provider for your ESB application inside jboss-esb.xml sets org.jboss.esb.jms.max.sessions.per.connection to 1.
<jms-provider name="WSMQ-Administered-Provider" connection-factory="WSMQConnectionFactory">
<!-- Needed if XA is required and com.ibm.mqetclient.jar is installed -->
<property name="org.jboss.esb.jms.max.sessions.per.connection" value="1"/>
<property name="org.jboss.esb.jms.max.xa.sessions.per.connection" value="1"/>
...
</jms-provider>
Related Solutions
Root Cause
- With
com.ibm.mqclient.jarinstalled, WMQ restricts the number of JMS Sessions per JMS Connection to 1. - Information about
org.jboss.esb.jms.max.sessions.per.connectionis documented in the This content is not included.Administration Guide
Product(s)
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.