Mysql and "Cannot login - password error" problem

Hello.

I’'m using Jive messenger 2.1.5 and 2.2.0 beta 1 with MySQL 4.1.9-standard.

I’'ve found that sometimes users cannot login. This happens when mysql drops the connections becouse of inactivity (I think so).

I’'ve tryed to update the mysql java connector to the last stable release (mysql-connector-java-3.1.10), but nothing happened.

I thing that the server have to do a “SELECT 0” every minute when it’‘s idle, so the connections doesn’‘t go down and MySQL doesn’‘t kill em (and when that happens, mysql-connector still think that the connection is up!). I had the same problem with another software that i’'ve developed 2 months ago. There are 2 way to solve that problem

  1. handle the exception. It’'s simple to reproduce, just use Mysql-Administrator (from mysql.com) and kill the connections of the Jive Server. Then try to log in.

  2. execute “SELECT 0” every minute. So the mysql connection doesn’‘t go down and jive don’'t have to re-establish the connection (that takes more time and CPU time than a simple “SELECT 0”. Not a clear solution but it works.

Thats the error.log (Jive Messenger 2.2.0 beta 1):

  • BEGIN NESTED EXCEPTION **

java.net.SocketException

MESSAGE: Broken pipe

STACKTRACE:

java.net.SocketException: Broken pipe

at java.net.SocketOutputStream.socketWrite0(Native Method)

at java.net.SocketOutputStream.socketWrite(Unknown Source)

at java.net.SocketOutputStream.write(Unknown Source)

at java.io.BufferedOutputStream.flushBuffer(Unknown Source)

at java.io.BufferedOutputStream.flush(Unknown Source)

at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2689)

at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2618)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1551)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)

at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)

at org.jivesoftware.messenger.auth.DefaultAuthProvider.authenticate(DefaultAuthPro vider.java:83)

at org.jivesoftware.messenger.auth.AuthFactory.authenticate(AuthFactory.java:118)

at org.jivesoftware.messenger.handler.IQAuthHandler.login(IQAuthHandler.java:224)

at org.jivesoftware.messenger.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:14 1)

at org.jivesoftware.messenger.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:213)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:73)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.net.SocketReader.processIQ(SocketReader.java:253)

at org.jivesoftware.messenger.net.ClientSocketReader.processIQ(ClientSocketReader. java:43)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:225)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:111)

at java.lang.Thread.run(Unknown Source)

  • END NESTED EXCEPTION **

Last packet sent to the server was 1 ms ago.

at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2707)

at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2618)

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1551)

at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2978)

at com.mysql.jdbc.Connection.execSQL(Connection.java:2902)

at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)

at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)

at org.jivesoftware.messenger.auth.DefaultAuthProvider.authenticate(DefaultAuthPro vider.java:83)

at org.jivesoftware.messenger.auth.AuthFactory.authenticate(AuthFactory.java:118)

at org.jivesoftware.messenger.handler.IQAuthHandler.login(IQAuthHandler.java:224)

at org.jivesoftware.messenger.handler.IQAuthHandler.handleIQ(IQAuthHandler.java:14 1)

at org.jivesoftware.messenger.handler.IQHandler.process(IQHandler.java:48)

at org.jivesoftware.messenger.IQRouter.handle(IQRouter.java:213)

at org.jivesoftware.messenger.IQRouter.route(IQRouter.java:73)

at org.jivesoftware.messenger.PacketRouter.route(PacketRouter.java:65)

at org.jivesoftware.messenger.net.SocketReader.processIQ(SocketReader.java:253)

at org.jivesoftware.messenger.net.ClientSocketReader.processIQ(ClientSocketReader. java:43)

at org.jivesoftware.messenger.net.SocketReader.readStream(SocketReader.java:225)

at org.jivesoftware.messenger.net.SocketReader.run(SocketReader.java:111)

at java.lang.Thread.run(Unknown Source)