Troubleshooting: Use Pure Java AWT on UNIX hosts to enable chart displays
Symptom
Using summary view rules, your applications can generate graphs and charts.
However, display of these charts depends on server software. Some UNIX platforms cannot support charts until you add Pure Java AWT jar files to the server.
By default, charting facilities depend on the server configuration. Pure Java AWT provides a native implementation of Java's Abstract Window Toolkit, eliminating any dependencies upon the host operating system's graphical subsystem (or lack thereof) such as the Win32 GDI or the variety of Unix X11R6-compatible display servers.
In most cases , errors related to such dependencies are seen on Unix or Unix-variant setups. If the default graphical subsystem is not available to the server, users experience exceptions. Traceback errors include the text
DISPLAY variable not configured
Unable to connect to X11 server
and come from the java.awt package.
Update: This article applies only to static (non-interactive) charts. Beginning with V5.2, interactive charts are available, supported by Adobe's Scalable Vector Graphics (SVG) plug-in. Beginning with V5.4, interactive charts are supported by Adobe's Flash Player plug in.
If your V5.2+ application includes only interactive charts — not static charts — the Pure Java AWT is not needed.
Solution
The eTeks PJA toolkit is redistributed with Process Commander. Install Pure Java AWT using the following steps:
- Install the libraries into your application server's classpath setup:
- For Tomcat, add the PJA jar files to the
\common\lib
directory. - For WebSphere, place the PJA jar files somewhere on disk, and reference them in the application server's bootclasspath.
- For WebLogic, place them on the disk and modify the startup scripts to include them.
- Update the JVM's
font.properties
file to support PJA. Thefont.properties
files are typically located in your$JAVA_HOME/jre/lib
directory. Consult your JVM documentation for information on which of the files is being resolved in your setup.
By default, the font.properties
file that the JVM ships with is written for use with the X11 font resolution mechanisms. You must update the file to use the style preferred by PJA. The font.properties
file maps the True Type fonts shipped as part of Java to a format that PJA can understand. Depending on the fonts shipped with your JVM (typically under $JAVA_HOME/jre/lib/fonts/
), you may need to alter the sample file.
- Configure your application server to use Pure Java AWT. This requires adding several JVM system property definitions to support PJA, including:
awt.toolkit
: Set the value tocom.eteks.awt.PJAToolkit
java.awt.graphicsenv
: Set the value tocom.eteks.java2d.PJAGraphicsEnvironment
java2d.font.userPlatformFont
: Se the value totrue
java.awt.fonts
: Set the value to the path of your JVM's font directory
This sample configuration was performed in a WebSphere 5.0 Application Server on Linux. Consider these steps as considered guidelines; the details may differ on your platform.
- Copy
pja.jar
andpjatools.jar
into/opt/WebSphere/AppServer/lib/
. (The Java Virtual Machine Properties for the application server's process definition were updated to include the jar files in the boot classpath.)
- Update the font.properties located in
/opt/WebSphere/AppServer/java/jre/lib/
- Return to the Java Virtual Machine Properties for the application server's Process Definition. Modify the Generic JVM arguments to include:
Dawt.toolkit=com.eteks.awt.PJAToolkit
Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
Djava2d.font.userPlatformFont=true
Djava.awt.fonts=/opt/WebSphere/AppServer/java/jre/lib/fonts
References
For information about the Eteks Pure Java AWT toolkit, see http://www.eteks.com/pja/en/
To review Sun's documentation for the font.properties file, see http://java.sun.com/j2se/1.3/docs/guide/intl/fontprop.html