Resolving 'Key store not found or is not valid' exception while creating resource template/instance from theCommand Line Interface (CLI).

Resolving 'Key store not found or is not valid' exception while creating resource template/instance from theCommand Line Interface (CLI).

book

Article ID: KB0089184

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix Service Grid -
TIBCO BPM Enterprise (formerly TIBCO ActiveMatrix BPM) -
TIBCO ActiveMatrix BusinessWorks Service Engine -

Description

Description:
Create security resource templates and instance (Identity Provider, Keystore Provider, SSL Client Provider and so on)  from the Command Line Interface (CLI).  The following exception can be seen if CLI runs from a remote machine (a machine other than TIBCO ActiveMatrix Administrator Server machine). 

***
Key store not found or is not valid: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreException: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreRuntimeException: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreRuntimeException: Unable to retrieve key store from URL(s) 
***

Symptoms:
The following is the complete error from running CLI script.

***
[AMXAdminTask] 14 Jan 2014 15:29:31 ERROR - Resource Instance Install failed
[AMXAdminTask] 14 Jan 2014 15:29:31 ERROR - Install resource instance 'httpclientrt_nic_ri10' failed : javax.security.auth.login.LoginException: java.lang.RuntimeException: Key store not found or is not valid: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreException: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreRuntimeException: com.tibco.trinity.runtime.base.provider.credential.keystore.KeystoreRuntimeException: Unable to retrieve key store from URL(s) C:/Users/nchacko/Documents/study_KB/key/myKey; errors were java.io.FileNotFoundException: Couldn't find file C:/Users/nchacko/Documents/study_KB/key/myKey at C:\Users\nchacko\Documents\study_KB\key\myKey. ..
***

Cause:
This error is coming from the Keystore Provider resource template and instance creation.The reason is that the Keystore Provider resource template configuration points to the local location to access the keystore. This should be changed so that the keystore will be uploaded to admin and admin will host the keystore.

Issue/Introduction

Resolving 'Key store not found or is not valid' exception while creating resource template/instance from theCommand Line Interface (CLI).

Resolution

To resolve this issue , use property 'internal' with value 'true' in the CLI script for creating the Keystore Provider resource template.

***
<ResourceTemplate
        xsi:type="amxdata:KeystoreCspResourceTemplate"
        name="KeystoreCspRT_nic10"
        description="This is Keystore RT"
        keyStoreLocation="C:/Users/nchacko/Documents/study_KB/key/myKey"
        keyStorePassword="tib123"
        keyStoreType="JCEKS"
        keyStoreProvider="SunJCE"
        keyStoreRefreshInterval="3600000"
        internal="true"/>
        
***