DB password encryption on an already installed jasper server


Hi Team,

I followed the below steps to get the encryption turned on :

1. Go to your Jaspersoft Install files: $jasper_install\jasperreports-server-5.6.1-bin\buildomatic\default_master.properties

2. Enter the correct value for Jasper DB Password in plain text

3. Ensure all other values are still valid, such as Tomcat directory etc.

4. Change the encrypt.done=true to encrypt=true

5. Save the file.

6. Now navigate to $jasper_install\jasperreports-server-5.6.1-bin\buildomatic

7. Run the command:

js-ant refresh-config

This will remove and recreate all the configuration files without deploying them to the application server.

I was able to get the password encrypted in context.xml located at $jasper_install\jasperreports-server-5.6.1-bin\buildomatic\build_conf\default\webapp\META-INF\ and I copied the same to  my tomact directory $JSTomcat\webapps\reportservice\META-INF\context.xml and restarted the server. After that I am not able to access the homepage.(http://localhost:8080/jasperserver/home.html)

It gives me HTTP Status 404 Error.

There are no error in the logs and below is the snippet from my context.xml

<Resource name="jdbc/jasperserver" auth="Container" type="javax.sql.DataSource"
        maxActive="100" maxIdle="30" maxWait="10000"
        username="postgres" password="ENC-80d75f96110c52d1b163b2a3838cb8bb3d643a4a6fa65e1812be0e258846952d-"
        accessToUnderlyingConnectionAllowed = "true"
        validationQuery="SELECT 1"
  <Service name="Catalina">
 <Connector port="8080" URIEncoding="UTF-8" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" scheme="http" secure="false" keystoreFile="D:/Users/aaashna/.keystore" keystorePass="changeit"/>
aashnanahar's picture
Joined: Mar 16 2017 - 12:49am
Last seen: 3 years 9 months ago

1 Answer:


On Apache Tomcat the encryption of password can be easily achieved by following steps:

1. change the encryption tag to true in default_master.properties.


2. From command prompt run the below command:

C:\Jaspersoft\jasperreports-server-6.3.0\buildomatic> js-ant refresh-config

this will give you the encrypted password in default_master.properties.

3. Replace that password with the plain text password in C:\Jaspersoft\jasperreports-server-6.3.0\apache-tomcat\webapps\jasperserver-pro\META-INF\context.xml.

username="postgres" password="ENC-c7a3834ea09b0c47dc9ea00cc390222bb3965623bcbe960ca73899be5ed3a020-"

Make sure the username and password in both the files(default_master.properties and context.xml) should be same.

Create and entry in C:\Jaspersoft\jasperreports-server-6.3.0\apache-tomcat\webapps\jasperserver-pro\WEB-INF\web.xml in case of an external db configuration.

    <description>My Database database</description>

4. start and stop the tomcat server and you are all set.




aashnanahar's picture
Joined: Mar 16 2017 - 12:49am
Last seen: 3 years 9 months ago