Hi,

I am currently using xampp with all the preloaded add ons, such as tomcat, mysql and apache. When i try to connect to the database through my computer with windows xp, it works perfectly fine. But when i changed it to another OS, windows vista. It keeps giving me the error, Communication Failure During Handshake.

So can i safely deduce that it is the OS problem ?

Thanks,
Heels

Dani AI

Generated

A few targeted checks and notes that build on what tried and on 's classpath advice.

First, narrow the failure down: confirm MySQL actually accepts TCP connections on the Vista box and Tomcat/your webapp can reach port 3306. From a Windows shell try quick connectivity checks:

netstat -an | find "3306"
telnet 127.0.0.1 3306
mysql -u root -p -h 127.0.0.1

If those fail, the problem is at the OS/service level (MySQL not running, binding only to IPv6, or Windows Firewall/UAC blocking sockets). If they succeed, check Tomcat and your webapp logs (catalina/logs and the app's logs) for the full stack trace — that points to classloading, driver mismatch, or SSL handshake details.

Driver placement and version matter. If the app uses a Tomcat-managed DataSource the JDBC driver must be visible to Tomcat (server/lib), whereas an app-only driver belongs in WEB-INF/lib. Do not run multiple copies of different driver versions in different classloaders; that causes weird handshake/class cast errors. Verify connector and server compatibility by checking the Connector/J docs and recommended versions: . Read Tomcat classloader guidance here: https://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html.

If the handshake message mentions SSL/TLS, verify whether the server requires encrypted connections and either enable SSL correctly in Connector/J or explicitly disable it (temporarily) for diagnosis. Also ensure Java and Connector/J versions are compatible. After each change, restart Tomcat and MySQL, and recheck the logs.

If you found solution would be nice if you share it instead of just simply closing down thread...

Sorry.
What i did was to reinstall the whole xampp again and download mysql-connector. Store it in the same folder as xampp and copy mysql-connector...bin.jar file into xampp/tomcat/lib and to xampp/tomcat/webapps/<foldername>/WEB-INF/lib

That was what i did, any better solutions ?

You should really install only server and database and configure it to your need. Do you need PHP option which comes with xampp? Basic configuration is not so difficult and be found .
Also it would be better if you keep only one instance of the JAR preferably one with project

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.