File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes java.net.SocketException: Broken pipe Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "java.net.SocketException: Broken pipe" Watch "java.net.SocketException: Broken pipe" New topic
Author

java.net.SocketException: Broken pipe

raghvendra bhargav
Greenhorn

Joined: Jan 25, 2007
Posts: 5
Hello Friends....
When I shifted my Java application which has MySQL(Linux has MySQL - 4.1.21-standard version. ) as a backend on Linux Platform I encountered following exception...

com.mysql.jdbc.CommunicationsException: 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:2692)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2621)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1552)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2994)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:936)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1030)
at ServerThread.run(ServerThread.java:98)


** END NESTED EXCEPTION **

its working fine when I tested it on Windows patform with MySql 5.0 as backend.
Please Help me. I get struck on this sproblem from last 2 days.
give me solution soon,please
raghvendra bhargav
Greenhorn

Joined: Jan 25, 2007
Posts: 5
Sushil Sharma
Greenhorn

Joined: Nov 02, 2006
Posts: 22
The broken pipe is due to TCP connection lost to backend. I do not think it is a problem with JDBC or your application, but can be network problem. I would check the following:
  • are both Linux and Windows platforms on same physical network (subnet)
  • heavy traffic on the network
  • From Linux box run ping command with MySql box IP. Do same from Windows. If there is no difference between time delays, contact your IT.

  • raghvendra bhargav
    Greenhorn

    Joined: Jan 25, 2007
    Posts: 5
    thanks sir for reply,

    this problem are occuring in my application server when the client maked the connection with server,then broken pipe exception are encounter.but my another application server similer to that, are running on that subnet.
    so please sir give me solution to solve that problem.

    thanks
    Joe Ess
    Bartender

    Joined: Oct 29, 2001
    Posts: 8997
        
        9

    Is there a firewall between your app server and database server, as is often the case with a public web server? The firewall may be configured to terminate long-lasting tcp connections.


    [How To Ask Questions On JavaRanch]
    raghvendra bhargav
    Greenhorn

    Joined: Jan 25, 2007
    Posts: 5
    nothing any firewall between my application server and database.when i login in my client side application and client connect to server then server through this exception.

    thanks
    Sushil Sharma
    Greenhorn

    Joined: Nov 02, 2006
    Posts: 22
    The broken socket exception happens in MySQL JDBC driver. Check whether you have correct version of the driver, or download the latest driver.
    raghvendra bhargav
    Greenhorn

    Joined: Jan 25, 2007
    Posts: 5
    sir i have check both mysql jdbc driver and jgt driver but both driver are giving similer exception.

    please give me right suggation.

    thanks for reply
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: java.net.SocketException: Broken pipe