Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Glassfish Keystore Error after adding MySQL Connector

Working on a school project and attempting to set up a JSF with Glassfish. Went through the motions of installing Glassfish, enabling it in Netbeans, and then installing the proper MySQL Driver from MySQL, copying it into the domains\domain1\lib folder after encountering the classPath error when attempting to run my program. After doing so I encounter a new error:

Ping Connection Pool failed for MySQL. The connection could not be allocated: Cannot open file:C:\Users(myusernamehere)\Documents\NetBeansProjects\glassfish5\glassfish\domains\domain1/config/keystore.jks [Keystore was tampered with, or password was incorrect] Please check the server.log for more details.

My JDK is updated appropriately:

c:>java -version java version "10.0.2" 2018-07-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13) Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)

I've established the connection through Netbeans to MySQL without issue, and confirmed both the user name and password are operational in a previous program (One I'm currently converting to this JSF app for my project). I'm at a loss for what's causing the error.

Edit: The errors indicate multiple different sources for the error that feed the same message. "Severe: RAR5110 : Error creating managed Connection with user and password : {0} java.sql.SQLNonTransientConnectionException: Cannot open file:C:\Users(myusernamehere)\Documents\NetBeansProjects\glassfish5\glassfish\domains\domain1/config/keystore.jks [Keystore was tampered with, or password was incorrect]" I've tried to switch to Payara instead of Glassfish, but when trying to establish a datasource connection it gives me a classpath error, despite having the updated J/Driver in the lib folder.

like image 671
Alex J Avatar asked Jul 30 '18 02:07

Alex J


3 Answers

add useSSL = false in the additional properties

Example URL:

jdbc:mysql://localhost:3306/practicas?useTimeZone=true&serverTimezone=UTC&autoReconnect=true&useSSL=false

like image 116
Luis Antônio Costa Filho Avatar answered Jan 03 '23 22:01

Luis Antônio Costa Filho


enter image description here

or you can put jdbc:mysql://localhost:3306/Peoples?autoReconnect=true&useSSL=false on URL pr.

like image 44
yoneeta Avatar answered Jan 03 '23 22:01

yoneeta


Ran into the same problem, changed the server to Apache, running fine now. The reason I found is I was using Glassfish 4.2.1, and MYSQL 8.0 (Which now has caching_sha2_password) which is not compatible with each other. Either Update your Glassfish version or move to apache

like image 32
Anukul Rawat Avatar answered Jan 03 '23 23:01

Anukul Rawat