I\'m swapping out a derby database for a MySQL one. I had everything working before but after what I thought was the proper configuration I\'m getting the error:
Cau
I copied the jar file to $glassfish_install_folder\glassfish\lib
, after that it worked. I use glassfish 4.0.
Check this link from oracle.
Looks like I am replying very late, but however people who would be referring to this thread may find the following information being useful. So I am posting it here:
There you go. If your MySql is running then it will ping the DB successfully
I encountered this issue in 2019 and would like to note that if you are using docker image payara/server-full
(I am using 5.194
so far) as I do the location to place the driver jar is:
/opt/payara/appserver/glassfish/domains/production/lib/
In the end I am doing something like this in the Dockerfile
of payara server:
RUN wget http://central.maven.org/maven2/org/mariadb/jdbc/mariadb-java-client/2.2.0/mariadb-java-client-2.2.0.jar \
-O /opt/payara/appserver/glassfish/domains/production/lib/mariadb-java-client-2.2.0.jar
I encountered this issue in 2018 and would like to note that if you are using glassfish 4 (current is 5) then it seems you have to use the Connector/J 5.1.47 version for it to work. If you use the current version (Connector/J 8.0.13) then exception mentioned in the original question keeps appearing, no matter where you place the .jar file.
With Connector/J 5.1.47 it works perfectly.
I've also added the MySQL driver .jars to the library of glassfish in both projects.
It was apparently not done right. The JAR has to go in /glassfish/domains/[domainname]/lib/ext
folder of the Glassfish installation where [domainname]
usually defaults to domain1
. You can and should not configure it from the Eclipse side on.