my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes communication link failure issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "communication link failure issue" Watch "communication link failure issue" New topic
Author

communication link failure issue

Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
i know this error is very much common, whenver i leave my app idel for more than 10 minutes i get this error and teh only soluiton as of now i bounce my tomcat server. i read many post and added some properties some user recommended, here is my hibernate.cfg.xml file
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">hms_user</property>
<property name="hibernate.connection.password">hms_user</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/hms
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.autoReconnect">true</property>
<property name="hibernate.connection.autoReconnectForPools">true</property>
<property name="hibernate.connection.is-connection-validation-required">true</property>
<mapping resource="/User.hbm.xml"/>
<mapping resource="/Test.hbm.xml"/>
<mapping resource="/UserSubscription.hbm.xml"/>
</session-factory>
</hibernate-configuration>
may i know where i am going wrong, btw i am using ThreadLocal, if you want to how i get hiberante session i could post it
ras13057@lasalamsa.com [~/tomcat/logs]# BEGIN NESTED EXCEPTION **
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
-bash: BEGIN: command not found
ras13057@lasalamsa.com [~/tomcat/logs]#
ras13057@lasalamsa.com [~/tomcat/logs]# java.io.EOFException
-bash: java.io.EOFException: command not found
ras13057@lasalamsa.com [~/tomcat/logs]#
ras13057@lasalamsa.com [~/tomcat/logs]# STACKTRACE:
-bash: STACKTRACE:: command not found
ras13057@lasalamsa.com [~/tomcat/logs]#
ras13057@lasalamsa.com [~/tomcat/logs]# java.io.EOFException
-bash: java.io.EOFException: command not found
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1395)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1539)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1930)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1168)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1279)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.Connection.execSQL(Connection.java:2281)
-bash: syntax error near unexpected token `('
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
ras13057@lasalamsa.com [~/tomcat/logs]# at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1634)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:397)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:318)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:177)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.hms.dao.UserDao.isUserValid(UserDao.java:94)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.hms.helper.UserHelper.isUserValid(UserHelper.java:40)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.hms.action.LoginAction.execute(LoginAction.java:69)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at com.hms.action.MainActionController.process(MainActionController.java:29)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# at java.lang.Thread.run(Thread.java:595)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]#
ras13057@lasalamsa.com [~/tomcat/logs]# at java.lang.Thread.run(Thread.java:595)
-bash: syntax error near unexpected token `('
ras13057@lasalamsa.com [~/tomcat/logs]# tail -500 catalina.out | more
Dec 26, 2006 4:44:04 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Dec 26, 2006 4:44:04 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2561 ms
/HMS/Login.do
2006-12-26 16:44:31,385 [ TP-Processor2] WARN com.hms.action.LoginAction.execute(LoginAction.java:53) - came in the execute
method of login action class
2006-12-26 16:44:31,397 [ TP-Processor2] WARN com.hms.dao.UserDao.isUserValid(UserDao.java:85) - came in the isuserAuthenti
cated method of userdao
2006-12-26 16:44:32,321 [ TP-Processor2] WARN net.sf.ehcache.config.Configurator.configure(Configurator.java:126) - No conf
iguration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/home/ras13057/public_html/HM
S/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
ARCHIVE PATHc:\rashid
/HMS/MainMenu.do
USER sessionUser
/HMS/Welcome.do
/HMS/Login.do
2006-12-26 16:54:11,632 [ TP-Processor4] WARN com.hms.action.LoginAction.execute(LoginAction.java:53) - came in the execute
method of login action class
2006-12-26 16:54:11,632 [ TP-Processor4] WARN com.hms.dao.UserDao.isUserValid(UserDao.java:85) - came in the isuserAuthenti
cated method of userdao
2006-12-26 16:54:11,646 [ TP-Processor4] WARN org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.
java:71) - SQL Error: 0, SQLState: 08S01
2006-12-26 16:54:11,650 [ TP-Processor4] ERROR org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.
java:72) - Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1395)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1539)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1930)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1168)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1279)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2281)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1634)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:397)
at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:318)
at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:177)
at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
at com.hms.dao.UserDao.isUserValid(UserDao.java:94)
at com.hms.helper.UserHelper.isUserValid(UserHelper.java:40)
at com.hms.action.LoginAction.execute(LoginAction.java:69)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at com.hms.action.MainActionController.process(MainActionController.java:29)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **


2006-12-26 16:54:11,652 [ TP-Processor4] WARN org.apache.struts.action.RequestProcessor.processException(RequestProcessor.j
ava:509) - Unhandled Exception thrown: class org.hibernate.exception.JDBCConnectionException
2006-12-26 16:54:11,655 [ TP-Processor4] ERROR org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.jav
a:253) - Servlet.service() for servlet action threw exception
org.hibernate.exception.JDBCConnectionException: could not execute query using iterate
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:420)
at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:318)
at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:177)
at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
at com.hms.dao.UserDao.isUserValid(UserDao.java:94)
at com.hms.helper.UserHelper.isUserValid(UserHelper.java:40)
at com.hms.action.LoginAction.execute(LoginAction.java:69)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at com.hms.action.MainActionController.process(MainActionController.java:29)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: Communication link failure: java.io.EOFException, underlying cause: null

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1395)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:1539)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1930)
--More--
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Let me add one more thing
i am using version which is a bit old Do you think this might be the issue. there are two version of mysql connector one is 3.1 and the other is 5.0
could anybody recommend which one should i use

Thanks
Rashid
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Could any body help me with this
Please i am stuck up with this right now

Thanks
Rashid
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Not an answer but what do you think this might mean

"org.hibernate.exception.JDBCConnectionException: could not execute query using iterate"

Maybe you don't have an openSession. Are you using the Open Session in View design pattern? Do you have a ServletFilter?

Please post code too.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Thanks
I went thru many threads on this error and looks like hibernate loses the connection depending on the some timeout parameter in mysql i cant remember the exact name. The strange thing is if i do a refresh i starts working again i can keep on working unlimited but should not keep the website idle for more than around 10 minutes. I added the parameter in cfg.xml file
<property name="hibernate.connection.autoReconnect">true</property>
<property name="hibernate.connection.autoReconnectForPools">true</property>
<property name="hibernate.connection.is-connection-validation-required">true</property>
and later on also updted my url to jdbc:mysql://localhost:3306/ras13057_hms?autoReconnect=true but still no luck some one told me to udgrade the msqljconnector to version 5.0 but still no luck. i would really appreicate if you could provide some input.is there some configuration need to be done at the datbase layer. for you reference i posted teh stack trace again. this time its copied correlty from my webserver. BTW, i am using the same conventional way of getting teh session using the HibernateUtil class copied from some reputed website, but still when i do refresh the app works again.
here is the stack trace again
2006-12-27 22:40:52,003 [ TP-Processor24] WARN com.hms.action.LoginAction.execute(LoginAction.java:53) - came in the execute
method of login action class
2006-12-27 22:40:52,004 [ TP-Processor24] WARN com.hms.dao.UserDao.isUserValid(UserDao.java:85) - came in the isuserAuthenti
cated method of userdao
2006-12-27 22:40:52,007 [ TP-Processor24] WARN org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.
java:71) - SQL Error: 0, SQLState: 08S01
2006-12-27 22:40:52,007 [ TP-Processor24] ERROR org.hibernate.util.JDBCExceptionReporter.logExceptions(JDBCExceptionReporter.
java:72) - Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Broken pipe

STACKTRACE:

java.net.SocketException: Broken pipe
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3176)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1153)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1266)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:397)
at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:318)
at org.hibernate.engine.query.HQLQueryPlan.performIterate(HQLQueryPlan.java:177)
at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:1156)
at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:46)
at com.hms.dao.UserDao.isUserValid(UserDao.java:94)
at com.hms.helper.UserHelper.isUserValid(UserHelper.java:40)
at com.hms.action.LoginAction.execute(LoginAction.java:69)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at com.hms.action.MainActionController.process(MainActionController.java:29)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:199)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:282)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:684)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:876)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Forgot to add this.
here my hibernate.cfg.xml file
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.username">ras13057_ras</property>
<property name="hibernate.connection.password">danira</property>
<property name="hibernate.connection.url">
jdbc:mysql://localhost:3306/ras13057_hms?autoReconnect=true
</property>
<property name="hibernate.connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="hibernate.connection.autoReconnect">true</property>
<mapping resource="/User.hbm.xml"/>
<mapping resource="/Test.hbm.xml"/>
<mapping resource="/UserSubscription.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Unfortunately, it sounds like a MySQL problem, and I am not using MySQL, and have never come accross that problem.

I wish I could help some more, maybe someone else has experience with this and MySQL.

Good Luck

Mark
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Once you get this error, you can do a refresh on the browser and this time there is no error. i had this kind of similar behavoir from many uses when you do a browser refersh the second attempt is successful. looks like this is more speicfic when you use hibernate with mysql. coz i have one more application run on teh same server which uses conventional jdbc to create connectin and fetch result set from mysql and it works fine no matter how long i keep it idle. i saw a lot of people having this communication link failure issue. it happended on my windows machine after i kept the app inactive for over a day. But it happends with in 10 minutes of inactivity on the webserver which runs on unix. most ot the post told to set the max_active parameter in mysql to be around like a day, so that even though the app is inactive for a day it still wont get this error. but what happens after one day, the error might still come. looks like hibernate has some issues with this. The only problem most of the forums asked me to do is to catch that exception and againg do a form post coz the second attempt is succeessful. i might revert back to using conventional jdbc approach since there is a lot of headache using mysql and i am not in control of configuring setting for mysql since i am using third party web hosting service. if anybody has any success by using any workaround, please let me know. but as of now i might go back to use conventional jdbc approach.
thanks
Rashid
Mike London
Ranch Hand

Joined: Jul 12, 2002
Posts: 1043
I am having this exact same problem with MySQL and broken pipe errors with Hibernate.

I have similar Hibernate config file with autoreconnect=true and other settings. I'm using MySQL 5.0.45.

I've tried every version of the JDBC driver from 3 to 5.1.6

Has anyone found a solution for this problem?

I'm using auto-generated Hibernate code written by MyEclipse so I'm comfortable it's OK. Also, this error does not occur locally so I'm not sure what to conclude from all these facts.

Thanks in advance for any replies or solutions to this problem.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: communication link failure issue
 
Similar Threads
java.net.SocketException: Broken pipe
JSP Page done loading but no data displayed (in mozilla).
communication link failure revised
hibernate 2.x -> 3.1 upgrade woes
IndexOutOfBounds in BeanUtils.Populate()