Java command to create or encrypt user_keystore_config file fails
search cancel

Java command to create or encrypt user_keystore_config file fails

book

Article ID: 416287

calendar_today

Updated On:

Products

CA Automic Applications Manager (AM)

Issue/Introduction

When creating and/or encrypting the user_keystore_config file as detailed in the Applications Manager documentation page Using Custom SSL Certificates for Connection Authentication, the java command may fail with the below error:

[amuser@amserver classes]$ java -DAW_HOME=${AW_HOME} -cp AppWorx.jar:uc4-ra.jar com.appworx.util.EncryptKeystoreFile password
Starting to create keystore_config file.
Exception in thread "main" java.lang.RuntimeException: Can't read environment variables.
        at com.appworx.util.EncryptKeystoreFile.loadEnvVariables(EncryptKeystoreFile.java:136)
        at com.appworx.util.EncryptKeystoreFile.main(EncryptKeystoreFile.java:45)
Caused by: java.io.IOException: Cannot run program "sh": error=13, Permission denied
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
        at java.base/java.lang.Runtime.exec(Runtime.java:681)
        at java.base/java.lang.Runtime.exec(Runtime.java:491)
        at java.base/java.lang.Runtime.exec(Runtime.java:366)
        at com.appworx.util.EncryptKeystoreFile.loadEnvVariables(EncryptKeystoreFile.java:105)
        ... 1 more
Caused by: java.io.IOException: error=13, Permission denied
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
        ... 6 more

 

This error is generally related to missing execute permissions on jspawnhelper, a java helper program invoked by Java Development Kit to to create a new process. Please refer to Java/Oracle for more information.

Cause

Java's $JAVA_HOME/lib/jspawnhelper program may not have execute permissions.

Resolution

Check to see if $JAVA_HOME/lib/jspawnhelper has execute permissions. 

If jspawnhelper does not have execute permission, execute permission can be granted by running the below command:

chmod +x $JAVA_HOME/lib/jspawnhelper

Please refer to your OS or Java admin if needed.