Error Message:

java.io.IOException: Keystore was tampered with, or password was incorrect

Possible Causes:

  1. Incorrect keystore password: The password in server.xml may not match the actual keystore password.

  2. Corrupted keystore: The keystore file might be damaged.

  3. Wrong keystore path: The path configured in server.xml might be incorrect.

  4. Incorrect keystore format: If the keystore was created using a different Java version, it might not be compatible with Java 5.

cat /hms/installs/tomcat4-GR/apache-tomcat-5.5.17/conf/server.xml
  1. Keystore file path (keystoreFile)

  2. Password (keystorePass)

  3. 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 block in server.xml.

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:

  1. Verify the Java version being used:

    java -version
    
  2. Update 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.

  3. Update Maven to use the correct Java version:

    export JAVA_HOME=/path/to/correct/java/version
    mvn clean install
    
  4. Run the application again:

    mvn spring-boot:run
    

This issue was resolved by updating the Java version and Maven configuration.


Written by A.M. Rinas