Problem
User has deployed TIBCO JasperReports® Server 7.5.0 on a Linux server. By default, the server specific encryption key files are deployed under Linux Root directory. Due to server administration restrictions, non admin users are not allowed to access any components in Linux Root location. Therefore, when JasperReports® Server 7.5.0 is started by a non admin user using root credential, the server startup will get an error caused by "KeystoreManager was never initialized or there are errors while instantiating the instance".
Requriement
Users need to place the encryption keystore files to a shared Linux folder.
Solution 1
To plan ahead, user can deploy JasperReports Server 7.5.0 using WAR distribution package. In default_master.properties file, user can add the following two property settings to override the default directory:
ks=${KEYSTORE_PATH} ksp=${KEYSTORE_PATH}
If user has a shared Linux folder such as /opt/keys/, then user should add the following to their default_master.properties file and run js-install script to redeploy JasperReports Server 7.5.0:
ks=/opt/keys ksp=/opt/keys
For a redepolyment of a JRS WAR distribution, users also need to run the following ANT scripts to clean up keystore.init.properties in the buildomatic directory beofre running the js-install script.
js-ant clean-config js-ant gen-config
If having a keystore.init.properties file directly under ..buildomatic directory, you need to delete it before running the installation.
Solution 2
If not wanting to redeploy JasperReports Server 7.5 to meet this requirement, users can do the following to move already deployed keystore files from default Root folder to another shared location (such as /opt/keys/ folder) and reconfigure JasperReports Server 7.5.0 to recognize this new location to find and use its keys.
- Edit ../WEB-INF/classes/keystore.init.properties file and change the setting to point to shared folder. For example:
ks=/opt/keys/ ksp=/opt/keys/
- Copy .jrsks (Java keystore) and .jrsksp (keystore properties) files from /Root to /opt/keys shared folder;
- Now the user should have two sets of these file pairs in both locations (/Root and /opt/keys). This is to ensure the user has a backup copy of the keystore files in the original location for system restore operation should the user mess up the manual procedure. Those two files must go together and synchronize with each other.
- Go to /opt/keys shared folder;
- Make sure both files have the proper access permssion for the user who will start the server;
- Do a Base64 decode to .jrsksp file. In our case, we used the following Linux command:
cat ~/.jrsksp | openssl base64 -d
- Edit the decoded .jrsksp file, locate ksPath setting, and change it from ksPath=/root/.jrsks to ksPath=/opt/keys/.jrsks
- Save the change;
- Use the following command to encode the file content
base64 .jrsksp
- Stop Tomcat;
- Clean up work and temp folders under /apache-tomcat (this is not mandatory but it is always a good practice);
- Start up Tomcat
- Login to this JasperReports Server instance from a web browser and test the web application.
In addition, users need to configure related files under buildomatic directory if they need to run import/export utilities from commandline. For example:
C:Jaspersoftjasperreports-server-7.5.0buildomaticconf_sourceieProkeystore.init.properties
TTC-20200330-1853218
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now