Hello Everyone,
I experiencing a database connection problem. I have tested my application locally and it worked fine but when I published it on the host server I keep getting the error code below :-
<!-- BEGIN ERROR STACK TRACE
<br /> net.jforum.exceptions.DatabaseException: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Communications link failure due to underlying exception:
<br />
<br /> ** BEGIN NESTED EXCEPTION **
<br />
<br /> java.net.SocketException
<br /> MESSAGE: Broken pipe
<br />
<br /> STACKTRACE:
<br />
<br /> java.net.SocketException: Broken pipe
<br /> at java.net.SocketOutputStream.socketWrite0(Native Method)
<br /> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
<br /> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
<br /> at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
<br /> at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
<br /> at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2637)
<br /> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
<br /> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
<br /> at com.mysql.jdbc.Connection.execSQL(Connection.java:3124)
<br /> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149)
<br /> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262)
<br /> at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
<br /> at net.jforum.dao.generic.GenericUserDAO.selectById(GenericUserDAO.java:136)
<br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:94)
<br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:112)
<br /> at net.jforum.JForum.service(JForum.java:163)
<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
<br /> at sun.reflect.GeneratedMethodAccessor1594.invoke(Unknown Source)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:597)
<br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
<br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
<br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
<br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
<br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
<br /> at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:597)
<br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
<br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
<br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
<br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
<br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
<br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
<br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
<br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
<br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
<br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
<br /> at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
<br /> at java.lang.Thread.run(Thread.java:619)
<br />
<br />
<br /> ** END NESTED EXCEPTION **
<br />
<br />
<br />
<br /> Last packet sent to the server was 1 ms ago.
<br />
<br /> Query being executed when exception was thrown:
<br />
<br /> SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid
<br /> at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2652)
<br /> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1554)
<br /> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
<br /> at com.mysql.jdbc.Connection.execSQL(Connection.java:3124)
<br /> at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1149)
<br /> at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1262)
<br /> at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
<br /> at net.jforum.dao.generic.GenericUserDAO.selectById(GenericUserDAO.java:136)
<br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:94)
<br /> at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:112)
<br /> at net.jforum.JForum.service(JForum.java:163)
<br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
<br /> at sun.reflect.GeneratedMethodAccessor1594.invoke(Unknown Source)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:597)
<br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
<br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
<br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:162)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
<br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
<br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
<br /> at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
<br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
<br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
<br /> at java.lang.reflect.Method.invoke(Method.java:597)
<br /> at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:244)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
<br /> at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:276)
<br /> at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:218)
<br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
<br /> at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
<br /> at org.apache.catalina.core.ApplicationFilterChain$1.run(ApplicationFilterChain.java:189)
<br /> at java.security.AccessController.doPrivileged(Native Method)
<br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:185)
<br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
<br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
<br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
<br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
<br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
<br /> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
<br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
<br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
<br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
<br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
<br /> at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
<br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
<br /> at java.lang.Thread.run(Thread.java:619)
<br /> Caused by: com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Communications link failure due to underlying exception:
<br />
<br />
<br />
<br /> ** END NESTED EXCEPTION **
<br />
<br />
<br />
<br /> Last packet sent to the server was 1 ms ago.
<br />
<br /> Query being executed when exception was thrown:
<br />
<br /> SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid
<br /> ... 53 more
<br />
<br /> URL is: /jforum/forums/list.page?null
<br /> END ERROR STACK TRACE-->
<html>
<head>
<title>Error</title>
</head>
<body>
An error has occurred.
For detailed error information, please see the HTML source code, and contact the forum Administrator.
<pre class="pre-error">
com.mysql.jdbc.exceptions.MySQLNonTransientConnectionException: Communications link failure due to underlying exception:
** END NESTED EXCEPTION **
Last packet sent to the server was 1 ms ago.
Query being executed when exception was thrown:
SELECT COUNT(pm.privmsgs_to_userid) AS private_messages, u.* FROM jforum_users u LEFT JOIN jforum_privmsgs pm ON pm.privmsgs_type = 1 AND pm.privmsgs_to_userid = u.user_id WHERE u.user_id = 1 GROUP BY pm.privmsgs_to_userid</pre>
</body>
</html>
Please help.
Thanks
[originally posted on jforum.net by Ali Jamac]