new install, unable to launch reports

Document ID : KB000100831
Last Modified Date : 24/09/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
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 

Locate the file in <CABI INSTALL>/apache-tomcat/bin/catalina.sh

Modify the file for the following. Add CATALINA_OPTS="$CATALINA_OPTS -Djava.awt.headless=true"

catalina.sh djava opts

Restart CABI Tomcat server
Additional Information:
Additional info on the error and solution: 

https://community.jaspersoft.com/wiki/error-when-running-reports-could-not-initialize-class 

There are two other suggestions for workaround to the error: 

1. Install xorg-x11-Xvfb-6.8.1-23.EL.i386.rpm 

https://community.jaspersoft.com/questions/514020/error-sunawtx11graphicsenvironment 

2. set system property to java.awt.headless=true 

https://stackoverflow.com/questions/3628302/jasperreports-noclassdeffounderror-exception-on-net-sf-jasperreports-engine-util