2 Replies Latest reply on Oct 15, 2003 8:56 PM by jonlee

    JBoss-2.4.10 Mysql  No ManagedConnections Available!

    sundaram

      Hi,

      We are using JBoss-2.4.10_Tomcat-4.0.6 bundle on Redhat Linux 8.0 with MySQL 3.23.56-1 and JDBC Driver (mysql-connector-java-3.0.8-stable-bin.jar).

      After running full night next day we are getting JDBC Error.

      Connection unavailable: java.lang.RuntimeException: No ManagedConnections Available!

      Here is my data source configuration value:


      DefaultDS
      org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

      jdbc:mysql://localhost:3306/DB?useUnicode=true

      1200000
      10
      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0


      Do I have to change some value to keep database connection alive?


      Here is more error message:
      2003-10-15 08:56:31,219 [JAWSPersistenceManager] java.sql.SQLException: Connection unavailable: java.lang.RuntimeException: No ManagedConnections Available!
      2003-10-15 08:56:31,220 [JAWSPersistenceManager] java.sql.SQLException: Connection unavailable: java.lang.RuntimeException: No ManagedConnections Available!
      2003-10-15 08:56:31,220 [STDOUT] PtceUtil:getRoomByStation Error occured retrieving room number for station : null - Connection unavailable: java.lang.RuntimeException: No ManagedConnections Available!
      2003-10-15 08:56:33,304 [JawsApplicationMetaData] Connection init failed
      java.lang.RuntimeException: No ManagedConnections Available!
      at org.jboss.pool.ObjectPool.getObject(ObjectPool.java:696)
      at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:252)
      at org.jboss.ejb.plugins.jaws.metadata.JawsApplicationMetaData.getConnection(JawsApplicationMetaData.java:116)
      at org.jboss.ejb.plugins.jaws.metadata.JawsEntityMetaData.getConnection(JawsEntityMetaData.java:218)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getConnection(JDBCCommand.java:673)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:148)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.execute(JDBCFinderCommand.java:88)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:183)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntities(JAWSPersistenceManager.java:145)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:315)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:591)
      at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:867)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:234)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:147)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:97)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:142)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:102)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:103)
      at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:429)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContainerInvoker.java:458)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:237)
      at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182)
      at $Proxy22.findByIpAddr(Unknown Source)
      at org.apache.jsp.idle$jsp._jspService(idle$jsp.java:74)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
      at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
      at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)

        • 1. Re: JBoss-2.4.10 Mysql  No ManagedConnections Available!
          jonlee

          It means you are running out of connections. You are running with a maximum of 10 connections. When it hits that limit and all are still in use, then you will get the "no connections available" message.

          You would need to figure out your connection requirements and tune accordingly. In case you are not expecting more than 10 concurrent connections, start checking for release times for connections to see if they are being released in a timely fashion.

          Also note that you will get the same problem if your database itself is unable to spawn any more connections. I think the default MySQL limit is 100 connections. YMMV.

          • 2. Re: JBoss-2.4.10 Mysql  No ManagedConnections Available!
            jonlee

            I forgot to metion that network glitches or the database shutting down or otherwise killing connections during a backup cycle or similar will also cause the problem as the connection manager does not recover from dead connections, as it currently stands.