This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Nested Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Nested Exception" Watch "Nested Exception" New topic

Nested Exception

Firoj Raj Rai

Joined: Jul 21, 2013
Posts: 4
whenever I'm inserting or retrieving some data from the database to or from the front-end I get the following Exception:
class errorcom.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:


at com.mysql.jdbc.MysqlIO.readFully(
at com.mysql.jdbc.MysqlIO.readPacket(
at com.mysql.jdbc.MysqlIO.doHandshake(
at com.mysql.jdbc.Connection.createNewIO(
at com.mysql.jdbc.Connection.<init>(
at com.mysql.jdbc.NonRegisteringDriver.connect(
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at databaseconnection.databasecon.getconnection(
at org.apache.jsp.newuser1_jsp._jspService(
at org.apache.jasper.runtime.HttpJspBase.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.jasper.servlet.JspServletWrapper.service(
at org.apache.jasper.servlet.JspServlet.serviceJspFile(
at org.apache.jasper.servlet.JspServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
at Source)
Last packet sent to the server was 0 ms ago.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10175

Based on the information you have provided it would appear you are prematurely closing some stream. Did you try running it in a debugger?

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Nick Wa

Joined: Nov 28, 2013
Posts: 5

Without seeing the source code and sample queries you're making, it's very difficult to determine the cause. Normally, EOFException is thrown when the data input stream ends. In this case, perhaps the stream was ended before data could be retrieved, unable to connect (i.e. where you specify the path to the database, username and password), timed out due to far too many connections, etc... .

"He who gets an error is a lucky man. He has a new lesson to learn from. He who has no errors is a lucky man." - Java prof
It is sorta covered in the JavaRanch Style Guide.
subject: Nested Exception
Similar Threads
new to db connection help needed
Server connection failure during transaction
Regarding a Communication Link Failure Error
new to servlet
MySQL with Eclipse3.2