Monday, March 7, 2016

Jasper Reports Not opening on all Environments

Sometimes your Jasper Reports work on one environment and don't work on others.

We get the following error -NoClassDefFoundError:net/sf/jasperreports/engine/util/JRStyledTextParser

If you look at the logs closely, you will get the root exception which gets thrown before the above exception.
Root Exceptionjava.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment

To solve this issue we have to set the following Argument at server start up ->
java.awt.headless=true

Java uses the underlying operating system to generate images. If you are using Unix and do not start the portal in a X Windows session, then Java will not know how to generate images and you'll get lots of nasty exceptions. Setting this property to true will fix that. Sometimes this property cannot be set dynamically when the server starts and you'll need to edit your start script to include this as a system property.

Steps ->

1) Login to weblogic console and click on servers.


2) Click on the "server" that you have configured.


3) Now click on "Server Start" Tab.



4) Add the following line (-Djava.awt.headless=true) in Arguments section as shown below.



No comments:

Post a Comment

Home