By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,313 Members | 2,798 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,313 IT Pros & Developers. It's quick & easy.

MySQL 5.0 and jdbc - unexpected end of input stream

P: n/a
MySQL 5.0 alpha (binary install) on
Solaris 9 -or- RedHat 8.0

mysql-connector-java-3.0.8-stable
-----------------------

Is there something different going on with JDBC and the alpha version
of MySQL 5.0? When trying to connect I am getting:

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

The client machine trying to connect to the server *CAN* connect via
the mysql command line client (ie. is has permission to the servers).
I have tried connecting to version 5.0 installs on both Linux and
Solaris with the same result. If I point the driver back to a 3.23.57
install, it works fine as always.

Here is more of the error, and code to connect further below:
------------------------------
java.sql.SQLException: Communication link failure:
java.io.IOException, underlying cause: Unexpected end of input stream

** BEGIN NESTED EXCEPTION **

java.io.IOException
MESSAGE: Unexpected end of input stream

STACKTRACE:

java.io.IOException: Unexpected end of input stream
at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:109 6)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:62 6)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1562)
at com.mysql.jdbc.Connection.<init>(Connection.java:4 91)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346)
at java.sql.DriverManager.getConnection(DriverManager .java:517)
at java.sql.DriverManager.getConnection(DriverManager .java:177)
at sffcrm.ConnectionHelper.getConnection(ConnectionHe lper.java:40)
at sffcrm.UtilityMan.loginCheck(UtilityMan.java:127)
at _0002fcontrol_0002ejspcontrol_jsp_0._jspService(_0 002fcontrol_0002ejspcontrol_jsp_0.java:126)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.tomcat.core.ServletWrapper.doService(Se rvletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.jav a:286)
at org.apache.tomcat.core.ServletWrapper.service(Serv letWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalServ ice(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(Cont extManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandl er.processConnection(HttpConnectionHandler.java:21 0)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Po olTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable. run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
** END NESTED EXCEPTION **
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:69 9)
at com.mysql.jdbc.Connection.createNewIO(Connection.j ava:1562)
at com.mysql.jdbc.Connection.<init>(Connection.java:4 91)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonReg isteringDriver.java:346)
at java.sql.DriverManager.getConnection(DriverManager .java:517)
at java.sql.DriverManager.getConnection(DriverManager .java:177)
at sffcrm.ConnectionHelper.getConnection(ConnectionHe lper.java:40)
at sffcrm.UtilityMan.loginCheck(UtilityMan.java:127)
at _0002fcontrol_0002ejspcontrol_jsp_0._jspService(_0 002fcontrol_0002ejspcontrol_jsp_0.java:126)
at org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWra pper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at org.apache.tomcat.core.ServletWrapper.doService(Se rvletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.jav a:286)
at org.apache.tomcat.core.ServletWrapper.service(Serv letWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalServ ice(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(Cont extManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandl er.processConnection(HttpConnectionHandler.java:21 0)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Po olTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable. run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
-------------------------------
code to connect:

String url=("jdbc:mysql://192.168.0.6/testdata");

String user=("myuser");
String password=("mypassword");

try {
//for mm.mysql 2.0.4 or less
//Class.forName("org.gjt.mm.mysql.Driver").newInstan ce();

//for Connector/J-3.0.8
Class.forName("com.mysql.jdbc.Driver").newInstance ();

Connection conn = DriverManager.getConnection(url, user,
password);

}
catch <snip..., etc.>
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.