Request management and problem tracking software
Bugzero one-for-all bug tracking and help desk support system
 
Q: The graphic report failed to be displayed and exceptions occurred.
   (This is about doing reports from the application. For installing
    the app using the GUI setup program on Lunux, X11 support is necessary.
    Use manual installation if X11 is not present, and then use the 
    following solution to run the application)

A: On Linux or Unix OS, an exception is thrown by the Java AWT toolkit when it
   can not make a connection to an X11 server. The exception can be something like
   "Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable".
   
   If your OS has graphics support, you need make sure that the local X11 is running,
   and the DISPLAY variable is correctly set. 

   If you are on a unix server that does not provide a graphical user environment,
   there are three options:

   1. Sun JDK 1.4 Headless mode
      If you are using JDK 1.4, then you can use the Headless graphics mode to launch 
      the server, ie, you can add a java argument of -Djava.awt.headless=true.
      For example, with Tomcat, add the following line in cataline.sh (or setclasspath.sh):

      JAVA_OPTS=-Djava.awt.headless=true

      Note that, it seems the presense of X11 runtime libraries is still needed, that
      is, an X11 environment must be installed into the system, but the X11 server 
      itself need not be started. For example, for RedHat Linux, the minimum set
      of X11 packages needed is:
        * XFree86
        * XFree86-libs

      In the case of Fedora, it may use Xorg instead of XFree86. After adding headless option
      and you get an error like:

      java.lang.UnsatisfiedLinkError:
      /usr/java/j2sdk1.4.1_02/jre/lib/i386/libfontmanager.so:
        libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory

      then, you need install

      compat-libstdc++-7.3-2.96.126.i386.rpm



      In another case, if you get an error like
      java.lang.UnsatisfiedLinkError: 
      /usr/lib/jvm/java-1.5.0-sun-1.5.0.16/jre/lib/i386/libawt.so: 
        libmlib_image.so: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1668)
	at java.lang.Runtime.loadLibrary0(Runtime.java:822)
	at java.lang.System.loadLibrary(System.java:993)
	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.image.ColorModel.loadLibraries(ColorModel.java:188)
	at java.awt.image.ColorModel.(ColorModel.java:196)
	at java.awt.image.BufferedImage.(BufferedImage.java:276)

      then, you may have a problem with your java.library.path. One possible fix is
      to add the following lines in your server start up script:

      if [ -d $JAVA_HOME/jre/lib/i386 ]; then
        export LD_LIBRARY_PATH=$JAVA_HOME/jre/lib/i386/
      fi 	


   2. Virtual X11 Frame Buffer (Xvfb)
      For JDK 1.3, the headless mode is not available. If you do not have X11 sever,
      you can install a lightweight Xvfb (XFree86-Xvfb package).
      In your server launch script (such as tomcat.sh), add the following lines:

       if [ -f /usr/X11R6/bin/Xvfb ]; then
          /usr/X11R6/bin/Xvfb :1 -screen 0 1x1x8 > /dev/null 2>&1 &
       fi
       export DISPLAY=:1.0

   3. Pure Java AWT (PJA) 
      Another option is PJA. For more detail and to download the software, go to
      http://www.eteks.com/pja/en/. 






* Reference brought to you by Bugzero, it's more than just bug tracking software!

Home - FAQs