3 Replies Latest reply on Sep 2, 2004 12:19 AM by kavuriprasad

    JBoss MySql Datasource issues

    gramani

      Hello,

      I have been running tests of our application for almost 8 weeks with different configurations of both JBoss(AS, CVSTag=JBoss_3_2_3 date=20031130) & MySql(DB 4.0.18). The application has a Inboud
      soap adapter, which then uses a series of tied up logic in EJB's (SFSB, MDB & Entity Bean's) that persists their states in MySql. A single input request atleast performs 10-25 updates/inserts
      into the DB, using Entity Beans. The tests works perfectly fine for 5 days, with the above mentioned process repeated every 20 seconds, but at the end of 5th day or atmost start of 6th day
      I end up getting MySql "Too Many connections" or "Unexpected end of input stream " error.

      Too many connectins should not allow any connection even from console (separate command prompt), but am able to log into mysql from a console, I had also bumped up the number of concurrent connections to 500, but i doubt its
      due to exhaustive number of connections. If that was the case mysql should not have allowed to connect from a command prompt. I tried to get the Innodb status, if there are any dead locks
      but the status was all clean. Every time I find at the same line of the connector / J stating either too many connections or end of i/p stream.

      I doubt JBoss is not able to manage the connection pools properly and too many connections are left open and the pool manager fails. As am able to fire a query and log into the DB both
      from mysql control center and command prompt, I dont see any issue in MySql. Two its only after 5 days of continuous JBoss handling requests (i.e., one request per 20 seconds, all request till 5 days are handled properly ) I land on this error.

      System Settings
      ======================
      Red Had Enterprise Linux 3
      512 GB RAM
      40 GB Hard disk
      JBoss 3.2.23
      MySQL 4.0.18
      mysql connector / J 3.1.14 production release

      Error thrown after 5 days
      ==========================

      Error trace 1:
      ===============
      java.io.IOException: Unexpected end of input stream
      at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1405)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1775)
      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1752)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:833)
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:1734)
      at com.mysql.jdbc.Connection.(Connection.java:562)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:361)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:150)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:477)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:213)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102

      Error trace 2:
      ===============
      java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections"
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:645)
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:1887)
      at com.mysql.jdbc.Connection.(Connection.java:440)
      at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:400)
      at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:150)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:477)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:213)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:496)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:425)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:318)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:477)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:149)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:111)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:38)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:579)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:311)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.java:322)
      at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:613)
      at sun.reflect.GeneratedMethodAccessor86.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:1043)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)


      Do let me know as what is going wrong, Is it issue with JBoss datasource management or am I missing something ?


      Thanks
      Ganesh