Upgrade from 5.1.18 to 5.1.19 breaks Tomcat/JDBC error
Posted by: Jim netdata
Date: April 19, 2012 06:55AM

I just upgraded the connector/J from 5.1.18 to 5.1.19 and kablooy!

It gave me error that pool can't shake hands with server. I switch back to version 5.1.18 and it works fine again.

here is the exact error:

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Bad handshake)

No other changes were done at all in any way to tomcat or mysql.

Here is my connecttion statement I ran in the Netbeans debugger and stepped through it and it blew up on the line cn = ds.getConnection();

Any reason this should be. I have not set any non default settings on the connection or in my.cnf relative to JDBC. Pool values are default.

try {
InitialContext ctx = new InitialContext();

if (ctx == null) {
return false;
}

DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/db-name-goes-here");

cn = ds.getConnection();
} catch (Exception e) {
res = false;
ma.emailDebug("ERROR safecallcn.java connect : " + e.toString() + "\r\n\r\n" + e.getMessage() + "\r\n\r\n");
}

HERE IS MY context.xml settings:

<Resource name="jdbc/db-name-goes-here"
auth="Container"
type="javax.sql.DataSource"
username="XXXX"
password="XXXX"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/db-name-goes-here"
maxIdle="7"
validationQuery="Select 1" />

Development Server is using following software:

CONNECTOR/J:

5.1.19

JAVA:

java version "1.7.0_147-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

MYSQL

mysql-5.5.21

TOMCAT:

Tomcat 7.0.27

KUBUNTU

11.10

Linux wstation1 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 8 20:45:39 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Options: ReplyQuote


Subject
Written By
Posted
Upgrade from 5.1.18 to 5.1.19 breaks Tomcat/JDBC error
April 19, 2012 06:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.