Jakarta Web Service SQL Access Error

Tom#234

Mitglied
When trying to access a MySQL database from a jakarta RESTful web service Resource file I get this error:

Cannot open file:/home/tom/glassfish-7.0.12/glassfish7/glassfish/domains/domain1/config/keystore.jks [Keystore was tampered with, or password was incorrect]|#]

When I put the same database access code into a different source file without jakarta / jersey it is working.

What could be the problem? How can I fix this?
 
Have you tried connecting without SSL by adding ?useSSL=false (or &useSSL=false, respectively) to the connection URL? If that works, check if there are any properties like clientCertificateKeyStoreUrl or trustCertificateKeyStoreUrl set.
 
Can you post the relevant part from the log file (Stacktrace, maybe including a few lines before the error)? Are you using the default domain? Did you set a master password? Did you change the keystore password?
 
Now it is running. Adding ?useTimeZone=true&serverTimezone=UTC&autoReconnect=true&useSSL=false to the connection string has fixed it. Thanks.
 
But be aware that this is only a valid "solution" in a test environment where security does not matter.

The core problem seems to be, that the certificate of the mysql server could not be checked. Accessing the keystore at /home/tom/glassfish-7.0.12/glassfish7/glassfish/domains/domain1/config/keystore.jks failed.

In a production environment, you should use ssl encrypted connections and make sure that a trusted certificate is used.
 

Zurück
Oben