Tomcat 9.x with Jaspersoft 7.9 won't run as a service
search cancel

Tomcat 9.x with Jaspersoft 7.9 won't run as a service

book

Article ID: 244802

calendar_today

Updated On:

Products

CA Service Desk Manager

Issue/Introduction

After installing Tomcat 9 and Jaspersoft, and then configuring Tomcat to run as a service, Jaspersoft won't work, but if we run Tomcat in foreground (with “startup.bat”) it works with no problems.  

We have verified the license file is in the correct place
Catalina log says: 
17-Jun-2022 08:45:04.856 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
17-Jun-2022 08:45:04.856 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/jasperserver-pro] startup failed due to previous error

Environment

Release : 17.3

Component :

Resolution

First, check to be sure that the version of Apache Tomcat being used has been tested certified with Jaspersoft 7.9.  This page from the documentation provides the detail:

https://docs.tibco.com/pub/js-jrs/7.9.0/doc/pdf/TIB_js-jrs_7.9_Platform-Support-Commercial-Edition.pdf?id=0

Apache/Jakarta Tomcat
8.5.0 - 8.5.43, 8.5.54, 8.5.57
9.0.1 - 9.0.27, 9.0.34, 9.0.37

If the version of Tomcat is higer than 9.0.37 it is recommended to revert back to 9.0.37 which can be downloaded from here: https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.37/bin/

If Tomcat has already been installed as a Windows service, it is best to uninstall it so that no Tomcat services are found in the Windows services list.  Instructions for this can be found here: https://tomcat.apache.org/tomcat-9.0-doc/windows-service-howto.html#Command_line_arguments

Follow the instructions on this page to install Jaspersoft using the "js-install.bat" script: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-installation-guide/v790/installing-war-file-using-js

Use the %CATALINA_HOME%\bin\service.bat script with parameter "install" to install Tomcat as a service.  The default service name using this method is "Tomcat9".

Use the %CATALINA_HOME%\bin\tomcat9w.exe application to complete the service configuration (tomcat9w.exe //ES//Tomcat9) and set up all the Java details:

(In the following example, jdk installed to C:\Program Files\Java\jdk1.8.0_333 and tomcat installed to C:\apache-tomcat-9.0.37.  Pay careful attention to each setting to ensure it reflects the correct home folder for Java JDK or Tomcat)

JVM:  C:\Program Files\Java\jdk1.8.0_333\jre\bin\server\jvm.dll

Java Classpath:  C:\Program Files\Java\jdk1.8.0_333\lib\tools.jar;C:\apache-tomcat-9.0.37\bin\bootstrap.jar;C:\apache-tomcat-9.0.37\bin\tomcat-juli.jar

Java Options:
-Djs.license.directory=C:\Users\Administrator
-Djs.license.directory=C:\Users\Administrator
-Dcatalina.home=C:\apache-tomcat-9.0.37
-Dcatalina.base=C:\apache-tomcat-9.0.37
-Dignore.endorsed.dirs=C:\apache-tomcat-9.0.37\endorsed
-Djava.io.tmpdir=C:\apache-tomcat-9.0.37\temp
-Djs.license.directory=C:\Users\Administrator
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\apache-tomcat-9.0.37\conf\logging.properties
 
Java9 Options:
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
-Xdebug
-Xrunjdwp:transport=dt_socket,address=9999,server=y,suspend=n
 
Initial memory pool: 2048 MB
Maximum memory pool: 4096 MB
(Memory pool settings are based on the recommended JVM settings described here: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-installation-guide/v790/setting-jvm-options-application#additional_646152231_1121908)

Then clicked “Apply” and “OK”.

The license file should be copied into the “C:\Windows\ServiceProfiles\LocalService” folder.

When all this configuration has been completed, start the Tomcat9 service and then watch the %CATALINA_HOME%\log\catalina<date>.log file to verify all aspects of Tomcat start up correctly.  A line similar to the following in that log file will ensure Tomcat startup is complete:

23-Jun-2022 20:59:03.277 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [225471] milliseconds