Error Message:
java.io.IOException: Keystore was tampered with, or password was incorrect
Possible Causes:
Incorrect keystore password: The password in server.xml may not match the actual keystore password.
Corrupted keystore: The keystore file might be damaged.
Wrong keystore path: The path configured in server.xml might be incorrect.
Incorrect keystore format: If the keystore was created using a different Java version, it might not be compatible with Java 5.
- Check Configuration
- Locate the server.xml file
cat /hms/installs/tomcat4-GR/apache-tomcat-5.5.17/conf/server.xml
- Find the SSL Connector section (<Connector port="8443") and check:
Keystore file path (keystoreFile)
Password (keystorePass)
Verify the Keystore File Run this command to check if the keystore exists:
keytool -list -keystore /path/to/your/keystore.jks
If prompted for a password, enter it and verify that it lists certificates.
How to Fix
If the password is incorrect, reset it using:
keytool -storepasswd -new NEW_PASSWORD -keystore /path/to/your/keystore.jks
If the keystore is missing or corrupted, create a new one:
keytool -genkey -alias tomcat -keyalg RSA -keystore /path/to/your/keystore.jks -validity 3650
If SSL is not needed, disable it by commenting out the
Additional Note:
To identify the process using the keystore or related resources, you can use the following command:
ps -fp 41308
This will display detailed information about the process with PID 41308, including the user, command, and other relevant details. Use this to verify if the correct application is accessing the keystore.
Additional Issue: UnsupportedClassVersionError
Error Message:
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version number in .class file
Cause:
This error occurs when the Java version used to compile the code is higher than the Java version used to run it.
Solution:
Verify the Java version being used:
java -versionUpdate the Java version to match the version used during compilation. For example, if the code was compiled with Java 11, ensure Java 11 is installed and set as the default.
Update Maven to use the correct Java version:
export JAVA_HOME=/path/to/correct/java/version mvn clean installRun the application again:
mvn spring-boot:run
This issue was resolved by updating the Java version and Maven configuration.
Written by A.M. Rinas