From: Michael Smith Date: Sun, 5 Sep 2004 11:32:31 +0000 (+0000) Subject: Bug #1022519 - graphics.xsl fails with error about no X11 server X-Git-Tag: release/1.79.1~6^2~4078 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2012958400e0a83c58b75c0929534d54217639eb;p=docbook-dsssl Bug #1022519 - graphics.xsl fails with error about no X11 server Problem Current stylesheets fail when trying to generate output under the following conditions: - Linux/Unix environment - no X server running - document contains graphics - use.extensions enabled This makes it impossible to try to do extensions-enabled automated transformations (e.g., nightly doc builds) in a server environment. Cause Certain methods in the DocBook "ImageIntrisics" extensions class rely on the Java AWT library, which by default expects a running X server. Fix Both the Saxon and Xalan2 versions of the extensions now set the "java.awt.headless" Java 1.4 system property to true. That property tells Java to continue processing AWT-based code even if no running X server is found. The property is set at the beginning of the constructor for the ImageIntrinsics class. Affects This change only affects transformations using Saxon or Xalan2 under the conditions: - Linux/Unix environment - no X server running - document contains graphics - use.extensions enabled --- diff --git a/xsl/extensions/saxon643/com/nwalsh/saxon/ImageIntrinsics.java b/xsl/extensions/saxon643/com/nwalsh/saxon/ImageIntrinsics.java index 6c32d2f8d..9dd22294f 100644 --- a/xsl/extensions/saxon643/com/nwalsh/saxon/ImageIntrinsics.java +++ b/xsl/extensions/saxon643/com/nwalsh/saxon/ImageIntrinsics.java @@ -40,6 +40,7 @@ public class ImageIntrinsics implements ImageObserver { *

Constructor for ImageIntrinsics

*/ public ImageIntrinsics(String imageFn) { + System.setProperty("java.awt.headless","true"); image = Toolkit.getDefaultToolkit().getImage (imageFn); width = image.getWidth(this); diff --git a/xsl/extensions/xalan2/com/nwalsh/xalan/ImageIntrinsics.java b/xsl/extensions/xalan2/com/nwalsh/xalan/ImageIntrinsics.java index e4dca7145..97a13a3a5 100644 --- a/xsl/extensions/xalan2/com/nwalsh/xalan/ImageIntrinsics.java +++ b/xsl/extensions/xalan2/com/nwalsh/xalan/ImageIntrinsics.java @@ -42,6 +42,7 @@ public class ImageIntrinsics implements ImageObserver { *

Constructor for ImageIntrinsics

*/ public ImageIntrinsics(ExpressionContext context, String imageFn) { + System.setProperty("java.awt.headless","true"); image = Toolkit.getDefaultToolkit().getImage (imageFn); width = image.getWidth(this);