Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Bank of Nova Scotia
CA
Last activity: 1 Aug 2019 10:46 EDT
Unable to Load Keystore into Data Page
We are trying to load a JKS File on a Linux Server using the instructions below:
We created an activity based on the instructions above. We got a 'java.lang.NumberFormatException: For input string: ""' in this line: keystoreUtils.loadKeystore(file)
We however was able to use the Keystore Data Instance Form to reference to the same file on the server successfully.
Any idea where we should look?
We are on Pega 8.1.3.
***Edited by Moderator: Lochan to tag SR***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
Pegasystems Inc.
US
I do not have 8.1.3 version, but I also tried 8.1.4 using fixed password in the keystore ruleform. Can you confirm that works or not? I verified that without checking 'passing current parameter page' in the load activity of the datapage, I got the same exception you got but keystore saved without errors after checking the flag.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
Pegasystems Inc.
US
You likely missed this step in the document:
Do the following steps to associate the activity with the data page.
- In the Activity name field, enter the name of the activity that creates and populates the keystore data page.
- Under the activity name, click Parameters.
- Select Pass current parameter page.
- Click Submit.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Bank of Nova Scotia
CA
I checked the "Pass current parameter page" option, and the same failure continues to occur:
The error came from this Java Snippets:
try {
java.io.FileInputStream file = new java.io.FileInputStream("
JKS_or_PKCS12_keystore_file_with_complete_path");
KeyStoreUtils keystoreUtils = pega.getKeyStoreUtils();
keystoreUtils.loadKeystore(file);
} catch(Exception ex){
oLog.error("Failed to load keystore into cache "+ex);
}
When I pulled the contents of the Exception, it is as follows:
'java.lang.NumberFormatException: For input string: ""'
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
Pegasystems Inc.
US
Did you replace JKS_or_PKCS12_keystore_file_with_complete_path with your actual path to the keystore file? e.g., in my case /Users/kevinzheng/pegatemp/test.jks. If yes, then we will have to investigate through SR. My test is done on 8.2.2 so that is a variable.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Bank of Nova Scotia
CA
Yes, we did change the path to the local directory on the server. Specifically, we have this:
try {
java.io.FileInputStream file = new java.io.FileInputStream("/tmp/keys/Conectado.jks");
KeyStoreUtils keystoreUtils = pega.getKeyStoreUtils();
keystoreUtils.loadKeystore(file);
} catch(Exception ex){
oLog.error("Failed to load keystore into cache "+ex);
exceptionMesg = ex.toString();
}
We were able to save and use a separate Keystore rule that references this JKS file in this this path, i.e.:
Keystore location: Reference to file
Keystore file path: /tmp/keys/Conectado.jks
I have tested this in 8.1.3, as well as inside the 7.3.1. LSA VM.
Accepted Solution
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/6edb6beb-cf8e-431c-9679-ef67ce5f3aba.jpg?itok=hzTHfrBw)
Pegasystems Inc.
US
I do not have 8.1.3 version, but I also tried 8.1.4 using fixed password in the keystore ruleform. Can you confirm that works or not? I verified that without checking 'passing current parameter page' in the load activity of the datapage, I got the same exception you got but keystore saved without errors after checking the flag.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Bank of Nova Scotia
CA
Kevin, that works. I have confirmed that the data page driven Keystore data instance was able to save with a fixed password. I have also tested that Keystore can be used with a Token Profile to generate JWT. So, it is all good.
I think the problem was that I started out testing the datapage on its own and did not get anything I expected, and then went on to test the activity. Now when I tested end to end with the saving the Keystore rule, I can the additional parameters being passed to the activity.
Thank you very much for the help. I will withdraw the SR then.
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/acf9b3f6-41e7-4ef2-9e55-8da39714b54f.jpg?itok=JYQYUbWS)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/1689951000/acf9b3f6-41e7-4ef2-9e55-8da39714b54f.jpg?itok=JYQYUbWS)
Pegasystems Inc.
IN
Thank you for confirming the solution! I have marked Kevin's reply as the Correct Answer.