CABI JasperServer new install, unable to launch reports X11 display error

Document ID : KB000100831
Last Modified Date : 19/12/2018
Show Technical Document Details
Issue:
After installing OC Report Manager server and CABI 6.3 and integrating w/ Spectrum, we are unable to run reports. We get one of two errors in the UI (and in catalina.out in CABI):

com.jaspersoft.jasperserver.api.JSException: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment

com.jaspersoft.jasperserver.api.JSException: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
Environment:
Spectrum 10.2.3
CABI JasperSoft 6.3, 6.4
Linux RHEL 7
Cause:
JasperSoft Java is trying to connect to an X11 display. Either X11 library files are not installed, or Java does not have to connect to a display and the error can be bypassed. 
Resolution:
1. Include the following JAVA-OPTS in Jasper startup script: -Djava.awt.headless=true 

Modify the catalina.sh file (located under the <CABI INSTALL>/apache-tomcat/bin directory) by adding the following:

CATALINA_OPTS="$CATALINA_OPTS -Djava.awt.headless=true"

catalina.sh djava opts

2. Restart CABI Tomcat server
Additional Information:
Additional info on the error and solution: 
There are two other suggestions for workaround to the error: 

1. Install xorg-x11-Xvfb-6.8.1-23.EL.i386.rpm 
2. set system property to java.awt.headless=true