Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

javax.resource.spi.ResourceAdapterInternalException: max connections reache

843830Feb 18 2008 — edited Feb 28 2008
Hello,
I am writing an application to read messages from queues.
Everything seems to be working fine, but after a number of un-deployments and deployments I start getting the following exception and have no choice but to restart the application server.

Any hint on what the root cause might be?

Exception stack trace:
2008-02-15 14:47:19,095 WARN  [org.jboss.system.ServiceController:424] Problem starting service jboss.j2ee:ear=Application-1.0.ear,jar=Application-1.0.jar,name=MDB,service=EJB3
org.jboss.deployment.DeploymentException: Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' activationSpec=javax.jms.Queue:wsmq/Q@@localhost; - nested throwable: (javax.resource.spi.ResourceAdapterInternalException: max connections reached)
	at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
	at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.activate(JBossMessageEndpointFactory.java:310)
	at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.start(JBossMessageEndpointFactory.java:194)
	at org.jboss.ejb3.mdb.MessagingContainer.startProxies(MessagingContainer.java:190)
	at org.jboss.ejb3.mdb.MessagingContainer.start(MessagingContainer.java:156)
	at org.jboss.ejb3.mdb.MDB.start(MDB.java:126)
	at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:103)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:417)
	at org.jboss.system.ServiceController.start(ServiceController.java:435)
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
	at $Proxy361.start(Unknown Source)
	at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:120)
	at org.jboss.ejb3.Ejb3Deployment.registerEJBContainer(Ejb3Deployment.java:301)
	at org.jboss.ejb3.Ejb3Deployment.start(Ejb3Deployment.java:362)
	at org.jboss.ejb3.Ejb3Module.startService(Ejb3Module.java:91)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:417)
	at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
	at $Proxy34.start(Unknown Source)
	at org.jboss.ejb3.EJB3Deployer.start(EJB3Deployer.java:512)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
	at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
	at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
	at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
	at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
	at $Proxy35.start(Unknown Source)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
	at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
	at $Proxy10.deploy(Unknown Source)
	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: javax.resource.spi.ResourceAdapterInternalException: max connections reached
	at com.ibm.mq.connector.ResourceAdapterConnectionPool.allocateConnection(ResourceAdapterConnectionPool.java:231)
	at com.ibm.mq.connector.ResourceAdapterImpl.endpointActivation(ResourceAdapterImpl.java:333)
	at org.jboss.resource.deployment.RARDeployment.endpointActivation(RARDeployment.java:271)
	at org.jboss.resource.deployment.RARDeployment.internalInvoke(RARDeployment.java:226)
	at org.jboss.system.ServiceDynamicMBeanSupport.invoke(ServiceDynamicMBeanSupport.java:156)
	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
	at org.jboss.ejb3.JmxClientKernelAbstraction.invoke(JmxClientKernelAbstraction.java:44)
	at org.jboss.ejb3.mdb.inflow.JBossMessageEndpointFactory.activate(JBossMessageEndpointFactory.java:305)
	... 101 more

............

ObjectName: jboss.j2ee:ear=Application-1.0.ear,jar=Application-1.0.jar,name=MDB,service=EJB3
  State: FAILED
  Reason: org.jboss.deployment.DeploymentException: Endpoint activation failed ra=jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' activationSpec=javax.jms.Queue:wsmq/Q@@localhost; - nested throwable: (javax.resource.spi.ResourceAdapterInternalException: max connections reached)
My current configuration is:
- JBoss 4.2.2-GA (linux)
- WS MQ 6.0.2.2 (linux)

I have configured JBoss the following way:
- added wmq.jmsra.rar to the $JBOSS_SERVER/deploy directory
- added com.ibm.mqetclient.jar to the $JBOSS_SERVER/lib directory
- created $JBOSS_SERVER/deploy/wmq.jmsra-ds.xml as follows
<?xml version="1.0" encoding="UTF-8"?>

<connection-factories>

  <!-- mbeans defining JCA administered objects -->
  <mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=wsmqQ">
    <attribute name="JNDIName">wsmq/Q</attribute>
    <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
    <attribute name="Type">javax.jms.Queue</attribute>
    <attribute name="Properties">
      baseQueueManagerName=QM1
      baseQueueName=Q
    </attribute>
  </mbean>

  <!-- JCA Connection factory definitions -->
  <tx-connection-factory>
    <jndi-name>MQCF</jndi-name>
    <xa-transaction />
    <rar-name>wmq.jmsra.rar</rar-name>
   <connection-definition>javax.jms.ConnectionFactory</connection-definition>
    <config-property name="channel" type="java.lang.String">SYSTEM.DEF.SVRCONN</config-property>
    <config-property name="hostName" type="java.lang.String">127.0.0.1</config-property>
    <config-property name="port" type="java.lang.String">1414</config-property>
    <config-property name="queueManager" type="java.lang.String">QM1</config-property>
    <config-property name="transportType" type="java.lang.String">CLIENT</config-property>
  </tx-connection-factory>
My java MDB (EJB3) is:
@MessageDriven(name = "MDB", activationConfig = {
        @ActivationConfigProperty(propertyName = "destination", propertyValue = "wsmq/Q"),
        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
        @ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
        @ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
        @ActivationConfigProperty(propertyName = "maxPoolDepth", propertyValue = "1") }, messageListenerInterface = MessageListener.class)
@ResourceAdapter("wmq.jmsra.rar")
public class MDB implements MessageListener {

    public void onMessage(Message message) {
        return;
    }

}
Thanks in advance for any information!
cheers!

Comments

PrafullaNath
I think there is no such command to trace a session.when ever a user gets connected to DB a session with sid,serial# gets associated with the user.

select sid,serial# from v$session where username='USER_NAME';

after that use

execute dbms_system.set_sql_trace_in_session(sid,serial#,true);

execute dbms_monitor.session_trace_enable(sid,serial#,true);
Pavan Kumar
Hi,
Enabling the trace to the user level
User level - its self reflects to Sessionw which it gets connected to ORACLE in order to Access the data/information.
Check with EXECUTE dbms_support.start_trace_in_session (9,29); else enable the trace @DB level for particular time and disable with out restart.

HTH

- Pavan Kumar N
- ORACLE OCP - 9i/10g
https://www.oracleinternals.blogspot.com
Aman....
I would not recommend to use DBMS_SUPPORT package since its not documented and is only meant for support. If you are on 10g and above, you can use DBMS_MONITOR package for the same.

HTH
Aman....
Pavan Kumar
Hi Aman,

Agree on that.. Sir... !! :-)

- Pavan Kumar N
DBA
Hi..Gurus,

thanks for the updates. I have used all these options earlier ,which were posted by you all, but sill i am not able to get the trace for spawned(child ) processes automatically. Only options is that i need to monitor closely v$session, and i need to enable the trace for each new spawned process, but it is very tedious job reason being my program takes approximately 5 hours to complete the entire job,


regards
DBA.
PrafullaNath
then better trace the entire instance/database
Hemant K Chitale
The procedure actually creates new sessions ? How and why ? How does it supply the SQLs to be executed by the child sessions ?

You could modify the code so that the SQL code it passes to the child session includes the DBMS_SESSION.START_TRACE call !



OR write a database LOGON trigger that enables tracing, based on the username.


Hemant K Chitale
1 - 7
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 27 2008
Added on Feb 18 2008
1 comment
568 views