2 Replies Latest reply: Jan 18, 2012 6:48 AM by gimbal2 RSS

    Problem while using JmsConnectionFactory for connection pooling

    911789
      Hello All,

      I am facing a problem with JmsConnection pooling, Here is my environment & Problem.

      Environment:
      JBoss: JBoss 4.2.3 GA
      JBossTransactions: 4.2.3 SP7
      JMS-RA: 4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA date=200807181439)
      JBoss Messaging: 1.4.2.GA-SP1
      JAVA: java 6.0_24

      Usage:
      Tring to use JmsConnection pooling with "JmsXA" configuration is as below

      <tx-connection-factory>
      <jndi-name>JmsXA</jndi-name>
      <xa-transaction/>
      <attribute name="XaTransaction" />
      <attribute name="TrackConnectionByTx" />
      <track-connection-by-tx/>     
      <rar-name>jms-ra.rar</rar-name>
      <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
      <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Queue</config-property>
      <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/CMSJMSProvider</config-property>
           <config-property name="Strict" type="java.lang.Boolean">true</config-property>
           <config-property name="ClientID" type="java.lang.String">CMSMessageClientId</config-property>
           <blocking-timeout-millis>10000</blocking-timeout-millis>
      <min-pool-size>20</min-pool-size>
      <max-pool-size>200</max-pool-size>
      <security-domain-and-application>JmsXAQRealm</security-domain-and-application>
      </tx-connection-factory>

      & Tring to look up in EJB 3.0 Stateless bean like this

      @Resource(mappedName = "java:/JmsXA")
      private ConnectionFactory mConnFactory;
      and tring to create JmsQueueSession from this factory like this:

      JmsSession session = mConnFactory.createQueueConnection().createSession(false, Session.AUTO_ACKNOWLEDGE);

      Problem:
      I keep on getting the following Exception & finally Quickly reaching GC Over limit with following Exception:

      2012-01-18 17:23:24,544 [] (WorkerThread#24[150.158.74.131:2789]:) ERROR [JmsSessionFactoryImpl] could not create session
      java.lang.NullPointerException
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:567)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:347)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:330)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:402)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:849)
      at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.allocateConnection(JmsSessionFactoryImpl.java:390)
      at org.jboss.resource.adapter.jms.JmsSessionFactoryImpl.createSession(JmsSessionFactoryImpl.java:370)
      at com.mbean.singleton.test.Level1Bean.send(Level1Bean.java:119)
      at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:112)
      at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:166)
      at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
      at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:112)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:95)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:62)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:110)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:46)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:304)
      at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:106)
      at org.jboss.aspects.remoting.AOPRemotingInvocationHandler.invoke(AOPRemotingInvocationHandler.java:82)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
      at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
      at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
      at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:549)
      at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)

      after few mins it will comes-up with following Exception:

      Heap dump file created [601359097 bytes in 20.762 secs]
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] Exception in thread "ScannerThread"
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] java.lang.OutOfMemoryError: GC overhead limit exceeded
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at java.util.Arrays.copyOf(Arrays.java:2882)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:390)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at java.lang.StringBuffer.append(StringBuffer.java:224)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.net.protocol.file.FileURLLister.createURL(FileURLLister.java:158)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.net.protocol.file.FileURLLister.listFiles(FileURLLister.java:130)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.net.protocol.file.FileURLLister.listFiles(FileURLLister.java:139)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.net.protocol.file.FileURLLister.listMembers(FileURLLister.java:75)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:497)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
      2012-01-18 17:27:02,169 [] (ScannerThread:) ERROR [STDERR] at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
      2012-01-18 17:27:20,141 [] (MERGE2.FindSubgroups thread (channel=TreeCache-Group):) ERROR [jgroups] uncaught exception in Thread[MERGE2.FindSubgroups thread (channel=TreeCache-Group),5,JGroups threads] (thread group=org.jgroups.util.Util$1[name=JGroups threads,maxpri=10] )
      java.lang.OutOfMemoryError: GC overhead limit exceeded
      at java.util.Arrays.copyOf(Arrays.java:2734)
      at java.util.Vector.ensureCapacityHelper(Vector.java:226)
      at java.util.Vector.add(Vector.java:728)
      at org.jgroups.protocols.MERGE2$FindSubgroups.findInitialMembers(MERGE2.java:336)
      at org.jgroups.protocols.MERGE2$FindSubgroups.run(MERGE2.java:291)
      at java.lang.Thread.run(Thread.java:662)
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] Exception in thread "Timer-5"
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] java.lang.OutOfMemoryError: GC overhead limit exceeded
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] at org.jgroups.protocols.TP$Bundler.bundleAndSend(TP.java:1623)
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] at org.jgroups.protocols.TP$Bundler.access$2500(TP.java:1569)
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] at org.jgroups.protocols.TP$Bundler$BundlingTimer.run(TP.java:1681)
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] at java.util.TimerThread.mainLoop(Timer.java:512)
      2012-01-18 17:27:28,643 [] (Timer-5:) ERROR [STDERR] at java.util.TimerThread.run(Timer.java:462)
      2012-01-18 17:27:38,613 [] (JCA PoolFiller:) ERROR [ExceptionUtil] ConnectionFactoryEndpoint[jboss.messaging.connectionfactory:service=ConnectionFactory] createFailoverConnectionDelegate [ffq2-l8srakxg-1-3vmfakxg-mjgi8b-n322e464]
      java.lang.OutOfMemoryError: GC overhead limit exceeded
      at java.util.Arrays.copyOfRange(Arrays.java:3209)
      at java.lang.String.<init>(String.java:215)
      at java.lang.StringBuffer.toString(StringBuffer.java:585)
      at org.jboss.util.id.UID.toString(UID.java:104)
      at org.jboss.util.id.GUID.toString(GUID.java:109)
      at org.jboss.messaging.util.GUIDGenerator.generateGUID(GUIDGenerator.java:38)
      at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.<init>(ServerConnectionEndpoint.java:170)
      at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegateInternal(ServerConnectionFactoryEndpoint.java:273)
      at org.jboss.jms.server.endpoint.ServerConnectionFactoryEndpoint.createConnectionDelegate(ServerConnectionFactoryEndpoint.java:171)
      at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.org$jboss$jms$server$endpoint$advised$ConnectionFactoryAdvised$createConnectionDelegate$aop(ConnectionFactoryAdvised.java:108)
      at org.jboss.jms.server.endpoint.advised.ConnectionFactoryAdvised.createConnectionDelegate(ConnectionFactoryAdvised.java)
      at org.jboss.jms.wireformat.ConnectionFactoryCreateConnectionDelegateRequest.serverInvoke(ConnectionFactoryCreateConnectionDelegateRequest.java:91)
      at org.jboss.jms.server.remoting.JMSServerInvocationHandler.invoke(JMSServerInvocationHandler.java:143)
      at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:908)
      at org.jboss.remoting.transport.local.LocalClientInvoker.invoke(LocalClientInvoker.java:106)
      at org.jboss.remoting.Client.invoke(Client.java:1719)
      at org.jboss.remoting.Client.invoke(Client.java:623)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:171)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
      at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
      at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
      at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
      at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
      at org.jboss.jms.client.JBossConnectionFactory.createXAConnection(JBossConnectionFactory.java:128)
      at org.jboss.jms.ConnectionFactoryHelper.createConnection(ConnectionFactoryHelper.java:78)
      at org.jboss.resource.adapter.jms.JmsManagedConnection.setup(JmsManagedConnection.java:800)
      at org.jboss.resource.adapter.jms.JmsManagedConnection.<init>(JmsManagedConnection.java:191)
      at org.jboss.resource.adapter.jms.JmsManagedConnectionFactory.createManagedConnection(JmsManagedConnectionFactory.java:109)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:619)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.fillToMin(InternalManagedConnectionPool.java:534)
      at org.jboss.resource.connectionmanager.PoolFiller.run(PoolFiller.java:74)
      2012-01-18 17:27:49,740 [] (JCA PoolFiller:) ERROR [STDERR] Exception in thread "JCA PoolFiller"
      2012-01-18 17:27:49,740 [] (JCA PoolFiller:) ERROR [STDERR] java.lang.OutOfMemoryError: GC overhead limit exceeded

      Tried to Analyse the Heap Dump looks like transactions are leaking out._

      Can any one help me to get out of this problem.

      Thanks in Advance,
      Jagan.