users@glassfish.java.net

Re:How to configure connection pool to resolve failure in obtaining connections

From: xuqingkang2 <xuqingkang2_at_163.com>
Date: Sun, 18 Jul 2010 01:06:10 +0800 (CST)

You can try following operation.
1,Specify [Idle Timeout] with a smaller value for urging recycling connection.
2,Specify [Maximum Pool Size] with a greater amount, restart the server instance for checking whether the same phenomenon still happen?
but all above are facile solution.
I suggest checking your application whether it hasn't close the connection after use it.
 
>
>Hi,
>I am using Glassfish Queue to do some offline processes and I encountered
>"RAR5117" that is "Failed to obtain/create connection from connection pool".
>I searched RAR messages and their solutions and I found that I have to check
>the connection pool configuration, but I don't know what should I set for
>the connection pool properties such as max-pool-size and max-wait-time to
>get rid of this error. Does this problem have another reason such as not
>releasing JMS resources properly.
>
>Thanks,
>Sargol
>
>
>
>
>
>[#|2010-06-02T10:39:46.563+0000|WARNING|sun-appserver9.1|javax.enterprise.resource.resourceadapter|_ThreadID=15;_ThreadName=httpSSLWorkerThread-47044-0;jms/auditConnectionFactory;In-use
>connections equal max-pool-size and expired max-wait-time. Cannot allocate
>more connections.;_RequestID=bcab107d-ac4c-4197-8836-79fbc8f5267c;|RAR5117 :
>Failed to obtain/create connection from connection pool [
>jms/auditConnectionFactory ]. Reason : In-use connections equal
>max-pool-size and expired max-wait-time. Cannot allocate more
>connections.|#]
>
>[#|2010-06-02T10:39:46.566+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=15;_ThreadName=httpSSLWorkerThread-47044-0;_RequestID=bcab107d-ac4c-4197-8836-79fbc8f5267c;|com.sun.messaging.jms.JMSException:
>MQRA:DCF:allocation failure:createConnection:Error in allocating a
>connection. Cause: In-use connections equal max-pool-size and expired
>max-wait-time. Cannot allocate more connections.
> at
>com.sun.messaging.jms.ra.DirectConnectionFactory._allocateConnection(DirectConnectionFactory.java:574)
> at
>com.sun.messaging.jms.ra.DirectConnectionFactory.createConnection(DirectConnectionFactory.java:262)
> at
>com.sun.messaging.jms.ra.DirectConnectionFactory.createConnection(DirectConnectionFactory.java:241)
> at
>com.kishware.core.framework.dao.audit.openjpa.util.OpenJPAUtils.postDirtyResult(OpenJPAUtils.java:340)
> at
>com.kishware.core.framework.audit.listener.GeneralEntityListener.postUpdateChanges(GeneralEntityListener.java:29)
> at sun.reflect.GeneratedMethodAccessor146.invoke(Unknown Source)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>org.apache.openjpa.event.BeanLifecycleCallbacks.makeCallback(BeanLifecycleCallbacks.java:85)
> at
>org.apache.openjpa.event.LifecycleEventManager.makeCallbacks(LifecycleEventManager.java:340)
> at
>org.apache.openjpa.event.LifecycleEventManager.fireEvent(LifecycleEventManager.java:302)
> at
>org.apache.openjpa.kernel.BrokerImpl.fireLifecycleEvent(BrokerImpl.java:688)
> at
>org.apache.openjpa.kernel.StateManagerImpl.fireLifecycleEvent(StateManagerImpl.java:352)
> at
>org.apache.openjpa.kernel.StateManagerImpl.afterFlush(StateManagerImpl.java:1008)
> at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2033)
> at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1908)
> at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1679)
> at
>org.apache.openjpa.kernel.DelegatingBroker.flush(DelegatingBroker.java:989)
> at
>org.apache.openjpa.persistence.EntityManagerImpl.flush(EntityManagerImpl.java:592)
> at
>com.sun.enterprise.util.EntityManagerWrapper.flush(EntityManagerWrapper.java:331)
> at
>com.kishware.core.gl.dao.jpa.EntityManagerExtension.save(EntityManagerExtension.java:90)
> at sun.reflect.GeneratedMethodAccessor152.invoke(Unknown Source)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at
>com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4005)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> at com.sun.ejb.Invocation.proceed(Invocation.java:498)
> at
>com.kishware.core.framework.interceptors.HistoryDataAssignerInterceptor.validate(HistoryDataAssignerInterceptor.java:65)
> at sun.reflect.GeneratedMethodAccessor150.invoke(Unknown Source)
> at
>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> at
>com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
> at
>com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:197)
> at
>com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:83)
> at $Proxy478.save(Unknown Source)
> at
>com.kishware.core.gl.service.main.GeneralLedgerImpl._reassignAuthorizedBranches(GeneralLedgerImpl.java:947)
> at
>com.kishware.core.gl.service.main.GeneralLedgerImpl.addEntryAndDimensions(GeneralLedgerImpl.java:279)
> 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:597)
> at
>com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1067)
> at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:176)
> at
>com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4005)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> at com.sun.ejb.Invocation.proceed(Invocation.java:498)
> at
>com.kishware.core.gl.interceptor.GLSelfConfig.checkIfRootNotExist(GLSelfConfig.java:64)
> 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:597)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> at com.sun.ejb.Invocation.proceed(Invocation.java:498)
> at
>com.kishware.core.framework.interceptors.TosanBusinessMethodInterceptor._intercept(TosanBusinessMethodInterceptor.java:286)
> at
>com.kishware.core.framework.interceptors.TosanBusinessMethodInterceptor.intercept(TosanBusinessMethodInterceptor.java:141)
> 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:597)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:579)
> at
>com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:483)
> at
>com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:205)
> at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3978)
> at
>com.sun.ejb.containers.WebServiceInvocationHandler.invoke(WebServiceInvocationHandler.java:189)
> at $Proxy232.addEntryAndDimensions(Unknown Source)
> 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:597)
> at com.sun.enterprise.webservice.InvokerImpl.invoke(InvokerImpl.java:81)
> at
>com.sun.enterprise.webservice.EjbInvokerImpl.invoke(EjbInvokerImpl.java:82)
> at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
> at
>com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)
> at
>com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
> at
>com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
> at
>com.sun.enterprise.webservice.MonitoringPipe.process(MonitoringPipe.java:147)
> at
>com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
> at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
> at
>com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:106)
> at com.sun.xml.ws.tx.service.TxServerPipe.process(TxServerPipe.java:317)
> at
>com.sun.enterprise.webservice.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:218)
> at
>com.sun.enterprise.webservice.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:129)
> at
>com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:115)
> at com.sun.x|#]
>
>[#|2010-06-02T10:39:46.567+0000|WARNING|sun-appserver9.1|javax.enterprise.system.stream.err|_ThreadID=15;_ThreadName=httpSSLWorkerThread-47044-0;_RequestID=bcab107d-ac4c-4197-8836-79fbc8f5267c;|ml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
> at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
> at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
> at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
> at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
> at
>com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
> at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
> at
>com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
> at
>com.sun.enterprise.webservice.Ejb3MessageDispatcher.handlePost(Ejb3MessageDispatcher.java:113)
> at
>com.sun.enterprise.webservice.Ejb3MessageDispatcher.invoke(Ejb3MessageDispatcher.java:87)
> at
>com.sun.enterprise.webservice.EjbWebServiceServlet.dispatchToEjbEndpoint(EjbWebServiceServlet.java:226)
> at
>com.sun.enterprise.webservice.EjbWebServiceServlet.service(EjbWebServiceServlet.java:155)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
> at
>com.sun.enterprise.web.AdHocContextValve.invoke(AdHocContextValve.java:114)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:87)
> at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
> at
>org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
> at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
> at
>com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
> at
>com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:380)
> at
>com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
> at
>com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
>Caused by: javax.resource.spi.ResourceAllocationException: Error in
>allocating a connection. Cause: In-use connections equal max-pool-size and
>expired max-wait-time. Cannot allocate more connections.
> at
>com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:353)
> at
>com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:189)
> at
>com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:165)
> at
>com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection(ConnectionManagerImpl.java:158)
> at
>com.sun.messaging.jms.ra.DirectConnectionFactory._allocateConnection(DirectConnectionFactory.java:569)
> ... 133 more
>Caused by: com.sun.enterprise.resource.PoolingException: In-use connections
>equal max-pool-size and expired max-wait-time. Cannot allocate more
>connections.
> at
>com.sun.enterprise.resource.AbstractResourcePool.getResource(AbstractResourcePool.java:472)
> at
>com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool(PoolManagerImpl.java:248)
> at
>com.sun.enterprise.resource.PoolManagerImpl.getResource(PoolManagerImpl.java:176)
> at
>com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnection(ConnectionManagerImpl.java:337)
> ... 137 more
>|#]
>
>--
>View this message in context: http://old.nabble.com/How-to-configure-connection-pool-to-resolve-failure-in-obtaining-connections-tp29190549p29190549.html
>Sent from the java.net - glassfish users mailing list archive at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>