[Logo]
MySQLNonTransientConnectionException  XML del.icio.us HEMiDEMi funP 收進你的MyShare個人書籤 新增到udn共享書籤 plurk twitter 分享
Forum Index » JForum中文社群 JForum Chinese Users Community
Author Message
lynx286

九級學員

Joined: 2008-04-24 12:03:16
Messages: 10
Offline

我的论坛也是jforum,几个小时没人访问以后,再访问就会出现下面错误:


An error has occurred.

For detailed error information, please see the HTML source code, and contact the forum Administrator.

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

Last packet sent to the server was 0 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


我是Tomcat 5.5 + mysql

Thanks!
lynx286

九級學員

Joined: 2008-04-24 12:03:16
Messages: 10
Offline

以下是右键察看源文件的错误信息:

<!-- BEGIN ERROR STACK TRACE
net.jforum.exceptions.DatabaseException: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

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
at sun.reflect.GeneratedConstructorAccessor114.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3134)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1818)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1961)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2543)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1737)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1888)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at net.jforum.dao.generic.GenericUserDAO.selectById(GenericUserDAO.java:136)
at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:94)
at net.jforum.repository.SecurityRepository.load(SecurityRepository.java:112)
at net.jforum.JForum.service(JForum.java:163)
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 net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
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:307)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:385)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:748)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:678)
at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:871)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

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
... 35 more

URL is: /forums/list.page?null
END ERROR STACK TRACE-->

<html>
<head>
<title>Error</title>
</head>
<body>
<p style="color:red; font-weight:bold">An error has occurred.</p><p>For detailed error information, please see the HTML source code, and contact the forum Administrator.</p><pre class="pre-error"><i>com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure

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</i></pre>
</body>
</html>

This message was edited 2 times. Last update was at 2008-04-24 19:50:47

andowson

五段學員
[Avatar]

Joined: 2007-01-02 22:20:40
Messages: 510
Location: 台北
Offline

您提到的SQL是UserModel.selectById,在generic_queries.sql裡面的內容如下:
UserModel.selectById = 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 = ? \
        GROUP BY pm.privmsgs_to_userid

其中user_id = 1時表示使用者為訪客(anonymous),這個錯誤可能是Session Timeout或Connection Timeout時,系統關閉資料庫連線,造成查詢使用者資料的這個查詢無法執行成功,應該對系統沒有太嚴重的影響,可以不予理會。

參考資料:
http://bugs.mysql.com/bug.php?id=35353

分享經驗 累積智慧
[WWW] [MSN]
 
Forum Index » JForum中文社群 JForum Chinese Users Community
Go to:   

交換連結乌托邦博客 
在本站刊登廣告
練功房推薦書單
SCJP 6.0認證教戰手冊 (附光碟) 雲端策略:雲端運算與虛擬化技術 SCJP Java 6專業認證手冊 Java認證SCJP 6.0/5.0--猛虎出閘 SCWCD 5 猛虎出閘:Java Web 應用程式專業認證 SCWCD專業認證手冊 Head First Servlets and JSP
[版權說明] 本站授權方式:創用CC 姓名標示-非商業性-相同方式分享 3.0 台灣 授權條款
Creative Commons License
Powered by JForum 2.2.0 © JForum Team