-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Communication Link Failure
PostPosted: Wed Feb 25, 2015 10:59 am 
Newbie

Joined: Wed Feb 25, 2015 10:44 am
Posts: 1
Hi All,

I am not able to understand the root cause of the following problem. So, Please provide your suggestions.

I am facing the "Communication Link Failure Error", almost daily. Though the same configuration existed earlier, we did not experience the frequency(daily) of the problem. I have tried few things like commit few uncommitted handles and closing the sessions, but it did not help.

I am using JSP/Servlets. Hibernate3, c3p0-0.9.1.2.jar, mysql-connector - 5.1.26. Upgraded to 5.1.30(not useful).

*******Error In Log File*********************************************
class ActionServlet method service : Problem with delegate actiongetAttribute: Session already invalidated
WARN [ajp-apr-8009-exec-1] org.hibernate.util.JDBCExceptionReporter: SQL Error: 0, SQLState: 08S01
ERROR [ajp-apr-8009-exec-1] org.hibernate.util.JDBCExceptionReporter: Communications link failure

The last packet successfully received from the server was 3,972,333 milliseconds ago. The last packet sent successfully to the server was 18,902 milliseconds ago.
The exception in method checkUser of class Dao is could not execute query
,039 DEBUG [ajp-apr-8009-exec-1] org.hibernate.SQL: select this_.unitid as unitid6_0_, this_.parent_unit as parent2_6_0_, this_.unitName as unitName6_0_ from new_timesheet_unit this_
2015-02-25 14:16:53,040 WARN [ajp-apr-8009-exec-1] com.mchange.v2.c3p0.impl.NewPooledConnection: [c3p0] A PooledConnection that has already signalled a Connection error is still in use!
2015-02-25 14:16:53,043 WARN [ajp-apr-8009-exec-1] com.mchange.v2.c3p0.impl.NewPooledConnection: [c3p0] Another error has occurred [ com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 3,972,404 milliseconds ago. The last packet sent successfully to the server was 18,973 milliseconds ago. ] which will not be reported to listeners!
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 3,972,404 milliseconds ago. The last packet sent successfully to the server was 18,973 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1121)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3941)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2551)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2818)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2157)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2324)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1812)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2129)
at org.hibernate.loader.Loader.list(Loader.java:2124)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:118)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1597)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:306)
at com..dao.Dao.getUnitid(Dao.java:1782)
at com..web.ActionImpl.perform(ActionImpl.java:1509)
at com..web.ActionServlet.delegateAction(ActionServlet.java:87)
at com..web.ActionServlet.service(ActionServlet.java:60)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:197)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2430)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2419)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:113)
at java.net.SocketOutputStream.write(SocketOutputStream.java:159)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3922)
... 44 more
WARN [ajp-apr-8009-exec-1] org.hibernate.util.JDBCExceptionReporter: SQL Error: 0, SQLState: 08S01
,048 ERROR [ajp-apr-8009-exec-1] org.hibernate.util.JDBCExceptionReporter: Communications link failure
******************************************************

*************hibernate.cfg.xml**************************
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<!-- add ?autoReconnect=true -->
<property name="connection.url">jdbc:mysql://localhost:3306/attra?autoReconnect=true</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>

<!-- JDBC connection pool (use the built-in) -->
<!-- <property name="connection.pool_size">20</property> -->

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>

<!-- Enable Hibernate's current session context -->
<property name="current_session_context_class">thread</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">false</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">update</property>


<!-- hibernate with C3p0 connection pool -->

<property name="connection.provider_class" >org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.acquire_increment">3</property>
<property name="hibernate.c3p0.idle_test_period">60</property>
<property name="hibernate.c3p0.max_size">500</property>
<property name="hibernate.c3p0.max_statements">180</property>
<property name="hibernate.c3p0.min_size">10</property>
<property name="hibernate.c3p0.timeout">60</property>
<property name="hibernate.c3p0.preferredTestQuery">Select 1</property>

<!-- Pretty print the SQL in the log and console. e.g. true | false -->
<property name="format_sql">false</property>

<!-- If turned on, Hibernate will generate comments inside the SQL, for easier debugging, defaults to false. e.g. true | false -->
<property name="use_sql_comments">false</property>
**************************************************************

Kindly let me know if I need to provide any other details.

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.