1 Reply Latest reply on Nov 26, 2003 3:03 AM by Jon Barnett

    MySql error, MESSAGE: Unexpected end of input stream

    AbhijitAbhijit Newbie


      I am using Jboss3.2 with MySql3.23.
      While I am trying to connect to database using JSP through EJB I am getting following error.

      I am using mysql-connector-java-3.0.9-stable jdbc driver.

      Please help me.

      Error In JBoss Server log

      2003-11-25 20:54:38,532 WARN [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Throwable while attempting to get a new connection:
      org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Communication link failure: java.io.IOException, underlying cause: Unexpected end of input stream


      MESSAGE: Unexpected end of input stream


      java.io.IOException: Unexpected end of input stream
      at com.mysql.jdbc.MysqlIO.readPacket(MysqlIO.java:1267)
      at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:510)
      at com.mysql.jdbc.Connection.createNewIO(Connection.java:1734)
      at com.mysql.jdbc.Connection.(Connection.java:562)

      In terminal where I have started MySql I get following error:

      [root@localhost bin]# /usr/bin/safe_mysqld: line 1: 2292 Segmentation fault nice --5 nohup /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-locking -u root
      /var/log/mysqld.log 2>&1

      Number of processes running now: 1
      mysqld process hanging, pid 2295 - killed
      031125 21:23:41 mysqld restarted

        • 1. Re: MySql error, MESSAGE: Unexpected end of input stream
          Jon Barnett Master

          The problem looks like it is the MySQL side of the connection. You are getting an OS segmentation fault. Most likely this is then causing the the connection to terminate as the MySQL connector/listener dies. This results in the Java side error you see.

          Check that MySQL works with the JDBC driver (test that you can connect) and that it executes whatever the SQL was that you were sending to it. Do this from a plain old Java program. However, judging by the exception, it is failing in establishing the connection.