Click to See Complete Forum and Search --> : Error :: Communications link failure due to underlying exception
Mr. Ram
03-06-2006, 04:42 AM
Current now, I am working on one struts application. The application working under Tomcat webserver and MySQL.
Sometimes, the tomcat console displaying the following error for this application:-
Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Software caused connection abort: recv failed
STACKTRACE: java.net.SocketException: Software caused connection abort: recv failed
But, the application is working fine.
Khalid Ali
03-06-2006, 10:47 AM
post a full stack trace if thats possible...
Mr. Ram
03-06-2006, 11:16 PM
Tue Feb 28 13:40:27 IST 2006 :: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ); - nested throwable: (javax.resource.ResourceException: No ManagedConnections available within configured blocking timeout ( 50000 [ms] ))
Thu Feb 16 12:56:09 IST 2006 :: Connection to the database could not be established; nested exception is: security.exception.SecurityDAOException: Connection to the database could not be established
Tue Feb 28 19:21:40 IST 2006 :: DataBase Exception occured while transacting with DB
Tue Feb 28 19:21:44 IST 2006 :: populatesessionBean=Could not create connection; - nested throwable: (java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections"); - nested throwable : (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections"))
I thought, JBoss unable to remove the Abandoned Connections for this specific applications.
Khalid Ali
03-07-2006, 12:17 AM
I thought, JBoss unable to remove the Abandoned Connections for this specific applications.
That makes sense, however since I have never worked with JBOss so not sure.
This is what I would do the first.
Make suer that when you perform query you close a connection once you are done (which means implement finally block with try catch) and close open conns in the finally block. To me seems like a design flaw....
Mr. Ram
03-07-2006, 02:25 AM
I have faced same problem in Tomcat. At that time, I have added the following tags in DB config.xml file without updating application code.
<!-- To configure a DBCP DataSource so that abandoned dB connections are removed and recycled add the following paramater to the ResourceParams configuration for your DBCP DataSource Resource: -->
<parameter>
<name>removeAbandoned</name>
<value>true</value>
</parameter>
<!--Use the removeAbandonedTimeout parameter to set the number of
seconds a dB connection has been idle before it is considered abandoned. -->
<parameter>
<name>removeAbandonedTimeout</name>
<value>60</value>
</parameter>
<!--The logAbandoned parameter can be set to true if you want DBCP to log a stack trace of the code which abandoned the dB connection resources -->
<parameter>
<name>logAbandoned</name>
<value>true</value>
</parameter>
Now, I am expecting the similar tags to add to mysql-ds.xml file in case of JBOSS without updating application code. Bz, we had only ear file.
Khalid Ali
03-07-2006, 02:42 AM
well that means that you will have to talk JBoss people and see which format of such configuration that use(af at all)...sounds like tomcat solution was server specific
Mr. Ram
03-17-2006, 01:21 AM
Created JIRA Issue: http://jira.jboss.com/jira/browse/JBCACHE-346
Mr. Ram
03-17-2006, 01:22 AM
Error :: Communications link failure due to underlying exception
This is because :
MySQL closes conections after 8 hours of inactivity.
autoReconnect=true