wood burning stoves 2.0*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Nested Exception" Watch "Nested Exception" New topic
Author

Nested Exception

Firoj Raj Rai
Greenhorn

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:

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1934)
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:483)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:992)
at com.mysql.jdbc.Connection.createNewIO(Connection.java:2572)
at com.mysql.jdbc.Connection.<init>(Connection.java:1485)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:266)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at databaseconnection.databasecon.getconnection(databasecon.java:14)
at org.apache.jsp.newuser1_jsp._jspService(newuser1_jsp.java:79)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
** END NESTED EXCEPTION **
Last packet sent to the server was 0 ms ago.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

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
Greenhorn

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
 
jQuery in Action, 2nd edition
 
subject: Nested Exception
 
Similar Threads
MySQL with Eclipse3.2
Server connection failure during transaction
Regarding a Communication Link Failure Error
new to db connection help needed
new to servlet