This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JForum and the fly likes Communication link failure: java.net.SocketException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » JForum
Bookmark "Communication link failure: java.net.SocketException" Watch "Communication link failure: java.net.SocketException" New topic
Author

Communication link failure: java.net.SocketException

Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hello there!

I have recently installed Jforum2.1.6 in my website which runs in resin server 2.X version and the database it uses is MySql 4

It works fine but sometimes randomly it throws the following error

Communication link failure: java.net.SocketException, underlying cause: Broken pipe

** 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:1743)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:1706)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1144)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1257)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2242)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1493)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at net.jforum.dao.generic.GenericPostDAO.selectAllByTopicByLimit(GenericPostDAO.java:295)
at net.jforum.view.forum.common.PostCommon.topicPosts(PostCommon.java:266)
at net.jforum.view.forum.PostAction.list(PostAction.java:152)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at net.jforum.Command.process(Command.java:116)
at net.jforum.JForum.service(JForum.java:182)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at com.caucho.server.http.FilterChainFilter.doFilter(FilterChainFilter.java:88)
at com.caucho.server.http.Invocation.service(Invocation.java:315)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
at com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:346)
at com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:274)
at com.caucho.server.TcpConnection.run(TcpConnection.java:139)
at java.lang.Thread.run(Thread.java:595)


** END NESTED EXCEPTION **


but when i logout and login again or when I go to other links and come back, the same page sometimes works fine.

Can anyone please tell me , what is the problem with my installation or what is the issue and how to fix it ?

thanks
Razia

[originally posted on jforum.net by razia]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
I have seen this happen with some versions of the mysql jdbc driver. There is a bizarre combination that may lead to these problems.

You can try using a different version of connector/j (and older doesn't means worst, in this case)

Rafael
[originally posted on jforum.net by Rafael Steil]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Hi!

Thanks for your reply.
It is very nice that you give very good support for jforum users.

I tried with couple of other versions of connector/J which are 3.1.6 and 3.1.14
. But still i get the same Broken pipe error randomly.
Temporarily I am working with simple connection.

Can any one mention the version of Connector/J which goes well with Jforum2.1.6 and pooled db connection?

Thanks,
Razia

[originally posted on jforum.net by razia]
Migrated From Jforum.net
Ranch Hand

Joined: Apr 22, 2012
Posts: 17424
Where are you having this problem? in some hosting company? I saw some places where you simple can't use a connection pool because the default configurations of mysql the hosting guys do.

You can try using C3P0 (which will be the default one on JForum 2.1.7+) instead of the connection pool that comes with JForum.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Communication link failure: java.net.SocketException