juretta.com

Java and MySQL on Mac OS X: 'java.io.IOException: Unexpected end of input stream'

August 19, 2006
Tags: Database Mac
While trying to get Struts working with MySQL 5 on Mac OS X 10.4 i got the following exception:
java.io.IOException: Unexpected end of input stream
        at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:339)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:782)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1585)
        at com.mysql.jdbc.Connection.(Connection.java:524)
[...]
After trying different versions of MySQL Server and MySQL/J-Connector i found out that there was an old JDBC-Driver in my user library ~/Library/Java/Extensions. It appears that on OS X this location takes precedence over the $CLASSPATH environment variable!

About

This is the defunct blog of Stefan Saasen.