List:MySQL and Java« Previous MessageNext Message »
From:emorales Date:May 13 2005 3:14pm
Subject:com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
View as plain text  
Hi,
I have a problem connecting from JDBC in Windows, when I try to execute:
conn = DriverManager.getConnection("jdbc:mysql://"
                                + pref.getProperty("dbms.host")
                                + ":" + pref.getProperty("dbms.port")
                                + "/" + pref.getProperty("dbms.sid")
                                + "?user=" + user + "&password=" + 
pwd.toString()
                                + "&autoReconnect=true");

I get this exception:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
com.mysql.jdbc.CommunicationsException: Communications link failure due to 
under
lying exception:

** BEGIN NESTED EXCEPTION **

java.io.EOFException

STACKTRACE:

java.io.EOFException
        at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1895)
        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2342)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2838)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:773)
        at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3612)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1204)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1699)
        at com.mysql.jdbc.Connection.<init>(Connection.java:408)
        at 
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:270)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at bb.db.Connection.<init>(Connection.java:71)
        at bb.Main.<init>(Main.java:34)
        at bb.Main.createAndShowMainFrame(Main.java:71)
        at bb.Main$1.run(Main.java:105)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown 
Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)


** END NESTED EXCEPTION **


        at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2554)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2838)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:773)
        at com.mysql.jdbc.MysqlIO.secureAuth411(MysqlIO.java:3612)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1204)
        at com.mysql.jdbc.Connection.createNewIO(Connection.java:1699)
        at com.mysql.jdbc.Connection.<init>(Connection.java:408)
        at 
com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
:270)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at bb.db.Connection.<init>(Connection.java:71)
        at bb.Main.<init>(Main.java:34)
        at bb.Main.createAndShowMainFrame(Main.java:71)
        at bb.Main$1.run(Main.java:105)
        at java.awt.event.InvocationEvent.dispatch(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown 
Source)

        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I saw this thread:

http://forums.mysql.com/read.php?39,16257,16257#msg-16257

in the forums... but any of the proposed solutions there apply to my case 
since I try connecting from the same windows machine using MySQL 
Administrator and I can get a connection from it...

The java version used for the application is:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ java -version
java version "1.5.0_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_03-b07)
Java HotSpot(TM) Client VM (build 1.5.0_03-b07, mixed mode)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And MySQL's J/Connector version is: mysql-connector-java-3.1.8-bin.jar

I'm connecting to a MySQL server:
mysql  Ver 14.9 Distrib 5.0.3-beta, for portbld-freebsd5.3 (i386)

Is there a bug or any in J/Connector or something like that? (I've already 
tryed with J/Connector versions 3.0 or 3.2 but neither correct the problem..

Thanks a lot in advance for any help.
Regards,

Ed.
Thread
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:emorales13 May
  • RE: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:Michael Stabler13 May
Re: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:emorales13 May
  • RE: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:Michael Stabler13 May