Rakhu Augustus
Rakhu Augustus

Reputation: 21

javax.jms.JMSException: maximum connections (50) reached error while configuring more than 50 resource adapters - MDB

We are getting the below exception when we try to configure more than 50 MDB (each MDB to a different MQ). I have tried changing the standalone.xml configuration as below, but still it didnt help. Could someone help us on this ?

standalone.xml

<short-running-threads>
    <core-threads count="90"/>
    <queue-length count="90"/>
    <max-threads count="90"/>
    <keepalive-time time="10" unit="seconds"/>
</short-running-threads>
<long-running-threads>
    <core-threads count="90"/>
    <queue-length count="90"/>
    <max-threads count="90"/>
    <keepalive-time time="10" unit="seconds"/>
</long-running-threads>

Stacktrace:

ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 185) MSC000001: Failed to start service jboss.deployment.subunit."test.ear"."testAppMDB.jar".component.TESTMDB.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test.ear"."TestAppMDB.jar".component.TESTMDB.START: java.lang.RuntimeException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure. at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_102] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_102] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_102] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_102] at org.jboss.threads.JBossThread.run(JBossThread.java:122) Caused by: java.lang.RuntimeException: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure. at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:209) at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.start(MessageDrivenComponent.java:181) at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14] ... 6 more Caused by: com.ibm.mq.connector.DetailedResourceAdapterInternalException: MQJCA1011: Failed to allocate a JMS connection., error code: MQJCA1011 An internal error caused an attempt to allocate a connection to fail. See the linked exception for details of the failure. at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:134) at com.ibm.mq.connector.services.JCAExceptionBuilder.buildException(JCAExceptionBuilder.java:105) at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection(ConnectionHandler.java:165) at com.ibm.mq.connector.inbound.MessageEndpointDeployment.acquireConnection(MessageEndpointDeployment.java:284) at com.ibm.mq.connector.inbound.MessageEndpointDeployment.(MessageEndpointDeployment.java:233) at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:393) at org.jboss.jca.core.rar.EndpointImpl.activate(EndpointImpl.java:191) at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponent.activate(MessageDrivenComponent.java:207) ... 8 more Caused by: javax.jms.JMSException: maximum connections (50) reached at com.ibm.mq.connector.in

Upvotes: 2

Views: 2754

Answers (3)

Doug Grove
Doug Grove

Reputation: 1045

You can increase the number number of available connections (defaults to 50):

    <subsystem xmlns="urn:jboss:domain:resource-adapters:5.0">
        <resource-adapters>
            <resource-adapter id="wmq-jmsra.rar" statistics-enabled="true">
                <archive>
                    wmq-jmsra.rar
                </archive>
                <config-property name="maxConnections">
                    100
                </config-property>

Upvotes: 0

Gas
Gas

Reputation: 18030

This exception

Caused by: javax.jms.JMSException: maximum connections (50) reached at com.ibm.mq.connector.inbound.ConnectionHandler.allocateConnection

is a result of default setting (50) of the maxConnection property in the WebSphere MQ Resource adapter. Check this page for more details Configuring properties for the IBM MQ resource adapter.

You need to change this property in the resource adapter configuration. I dont know how you configure it in JBoss, but in WebSphere you do it via Resources > JMS > JMS providers > Resource adapter properties.

Upvotes: 1

Justin Bertram
Justin Bertram

Reputation: 35038

It's hard to tell from the formatting of the stack-trace, but it appears to me that the exception is coming from the WebSphereMQ JCA Resource Adapter which indicates that the problem is with the configuration of the WebSphereMQ server which appears to be limiting the number of possible connections to 50. Changing thread-pool configurations in the JBoss application server isn't going to resolve the issue. You need to change the WebSphereMQ server to allow more than 50 connections.

Upvotes: 0

Related Questions