Bug #9415 I cannot connect to mysql DB
Submitted: 27 Mar 2005 7:13 Modified: 27 Mar 2005 15:08
Reporter: [ name withheld ] Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:4.1.10 OS:Windows (XP)
Assigned to: CPU Architecture:Any

[27 Mar 2005 7:13] [ name withheld ]
Description:
I'm getting the next exception:

Exception: 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:1080)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:619)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1532)
        at com.mysql.jdbc.Connection.<init>(Connection.java:486)
        at com.mysql.jdbc.Driver.connect(Driver.java:341)
        at com.mysql.jdbc.NonRegisteredDriver.connect(NonRegisteredDriver.java:326)
        at java.sql.DriverManager.getConnection(DriverManager.java:512).....
......
** END NESTED EXCEPTION **

when i try to connect to mysql DB when i use the class like JWS (java web service). But when i test the same class in the Command Prompt i dont have any problem....PLEASE I NEED YOUR HELP!!! 

I have Tomcat 4 and MySQL 4.1.10, and mysql-connector-java-3.1.7-bin.jar.....

If somebody can help, i really apreciated....thanks!

How to repeat:
when i try to connect to mysql DB when i use the class like JWS (java web service)
[27 Mar 2005 15:08] Mark Matthews
From your stacktrace it appears you have an older version of the JDBC driver laying around in your classpath (mm.mysql-2.0.14 or Connector/J 2.0.14). The line numbers and call stack don't line up with any 3.0 release that I'm aware of.

The 2.0.14 version of the drivers can not connect to MySQL-4.1.x or newer, as the authentication protocol has changed, and you will get an exception that is similar (or the same) as the one you are reporting.