Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.net.SocketException: Broken pipe

 
raghvendra bhargav
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Sushil Sharma
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 9312
    10
    Linux Mac OS X Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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.
     
    raghvendra bhargav
    Greenhorn
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 22
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 5
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic