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

Karthick2003
What do you mean by compare? Can you explain a bit more?
Dbb
Select a.empcode, sum(a.totalvalue) , sum(b.totalvalue )
from table_sales a, table_sales b
where a.empcode = b.empcode
and a.trndate between ......
and b.trndate between ........
group by a.empcode

Edited by: Agustin UN on 08-nov-2010 13:22
726742
Do you mean Sum(totalvalue) between those periods?
select 
Select sum(totalvalue) from table where trndate between to_date('01-10-2010', 'DD-MM-YYYY') AND  to_date('08-01-2010', 'DD-MM-YYYY')

SELECT ((SELECT SUM(totalvalue)
         FROM   table1
         WHERE  trndate BETWEEN to_date('01-10-2010', 'DD-MM-YYYY') AND
                to_date('08-10-2010', 'DD-MM-YYYY')) -
       (SELECT SUM(totalvalue)
         FROM   table1       
         WHERE  trndate BETWEEN to_date('01-11-2010', 'DD-MM-YYYY') AND
                to_date('01-11-2010', 'DD-MM-YYYY')))
FROM   dual
Be more clear on your requirement :)
787094
I need some what like that, but there is a problem that if there is no sales in one range reports are not coming properly.

Please help

Thanks

Niloy
726742
SELECT ((SELECT SUM(nvl(totalvalue,0))
         FROM   table1
         WHERE  trndate BETWEEN to_date('01-10-2010', 'DD-MM-YYYY') AND
                to_date('08-10-2010', 'DD-MM-YYYY')) -
       (SELECT SUM(nvl(totalvalue,0))
         FROM   table1       
         WHERE  trndate BETWEEN to_date('01-11-2010', 'DD-MM-YYYY') AND
                to_date('01-11-2010', 'DD-MM-YYYY')))
FROM   dual
787094
I have table with the following data :

custcode emp Trndate Totalvalue
1 1 2010-10-01 500.00
2 1 2010-10-02 500.00
3 1 2010-10-03 500.00
4 1 2010-10-08 100.00
5 1 2010-11-02 175.00
6 5 2010-11-01 130.00
7 5 2010-11-02 135.00
8 5 2010-11-03 130.00
9 6 2010-10-01 100.00
10 6 2010-10-02 12.00


I'd like to build a query that returns something like this:

Empcode TotalSales_OCT TotalSales_NOV
====== ========= ===========
1 1600 175
5 0 395
6 112 0


Please help...

Thanks
Dbb
Select a.empcode,b.empcode, sum(a.totalvalue) , sum(b.totalvalue )
from table_sales a, table_sales b
where a.empcode(+) = b.empcode
and a.trndate(+) between ......
and b.trndate(+) between ........
group by a.empcode
Union
Select a.empcode,b.empcode, sum(a.totalvalue) , sum(b.totalvalue )
from table_sales a, table_sales b
where a.empcode = b.empcode(+)
and a.trndate(+) between ......
and b.trndate(+) between ........
group by a.empcode

Edited by: Agustin UN on 08-nov-2010 13:50
Dbb
with table_sales as (
select 1 custcode, 1 empcode, '2010-10-01' Trndate, 500.00 Totalvalue from dual union
select 2, 1, '2010-10-02', 500.00 from dual union
select 3, 1, '2010-10-03', 500.00 from dual union
select 4, 1, '2010-10-08', 100.00 from dual union
select 5, 1, '2010-11-02', 175.00 from dual union
select 6, 5, '2010-11-01', 130.00 from dual union
select 7 ,5, '2010-11-02', 135.00 from dual union
select 8, 5, '2010-11-03', 130.00 from dual union
select 9, 6, '2010-10-01', 100.00 from dual union
select 10, 6, '2010-10-02', 12.00 from dual
)
Select a.empcode, sum(a.totalvalue) , sum(b.totalvalue)
from table_sales a ,table_sales b
where
a.empcode = b.empcode(+)
and a.Trndate(+) between '2010-10-01' and '2010-10-31'
and b.Trndate(+) between '2010-11-01' and '2010-11-30'
group by a.empcode
union
Select b.empcode empcode, sum(a.totalvalue) , sum(b.totalvalue)
from table_sales a ,table_sales b
where
a.empcode(+) = b.empcode
and a.Trndate(+) between '2010-10-01' and '2010-10-31'
and b.Trndate(+) between '2010-11-01' and '2010-11-30'
group by b.empcode
Aketi Jyuuzou
In this case,Pivot clause is not useful :D
with table_sales(custcode,empcode,Trndate,Totalvalue) as(
select 1, 1,date '2010-10-01',500.00 from dual union
select 2, 1,date '2010-10-02',500.00 from dual union
select 3, 1,date '2010-10-03',500.00 from dual union
select 4, 1,date '2010-10-08',100.00 from dual union
select 5, 1,date '2010-11-02',175.00 from dual union
select 6, 5,date '2010-11-01',130.00 from dual union
select 7 ,5,date '2010-11-02',135.00 from dual union
select 8, 5,date '2010-11-03',130.00 from dual union
select 9, 6,date '2010-10-01',100.00 from dual union
select 10,6,date '2010-10-02', 12.00 from dual)
select empcode,
sum(case when Trndate
         between date '2010-10-01' and date '2010-10-08'
         then Totalvalue else 0 end) as OCT,
sum(case when Trndate
         between date '2010-11-01' and date '2010-11-08'
         then Totalvalue else 0 end) as NOV
  from table_sales
group by empcode
order by empcode;

EMPCODE   OCT  NOV
-------  ----  ---
      1  1600  175
      5     0  395
      6   112    0
ramanlakunde
SELECT ((SELECT SUM(nvl(totalvalue,0))
FROM table1
WHERE trndate BETWEEN to_date('01-10-2010', 'DD-MM-YYYY') AND
to_date('08-10-2010', 'DD-MM-YYYY') group by empcode) -
(SELECT SUM(nvl(totalvalue,0))
FROM table1
WHERE trndate BETWEEN to_date('01-11-2010', 'DD-MM-YYYY') AND
to_date('01-11-2010', 'DD-MM-YYYY') group by empcode))
FROM dual
787094
Hi,
If I put this query I got the following error :

SELECT ((SELECT SUM(nvl(dispvalue,0))
*
ERROR at line 1:
ORA-01427: single-row subquery returns more than one row


Thanks
Niloy
1 - 11
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
562 views