org.apache.xalan.xslt
Class EnvironmentCheck

java.lang.Object
  |
  +--org.apache.xalan.xslt.EnvironmentCheck

public class EnvironmentCheck
extends java.lang.Object

Utility class to report simple information about the environment. Simplistic reporting about certain classes found in your JVM may help answer some FAQs for simple problems. Usage-command line: java org.apache.xalan.xslt.EnvironmentCheck [-out outFile] Usage-from program: boolean environmentOK = (new EnvironmentCheck()).checkEnvironment(yourPrintWriter); Xalan users reporting problems are encouraged to use this class to see if there are potential problems with their actual Java environment before reporting a bug. Note that you should both check from the JVM/JRE's command line as well as temporarily calling checkEnvironment() directly from your code, since the classpath may differ (especially for servlets, etc). Also see http://xml.apache.org/xalan-j/faq.html Note: This class is pretty simplistic: it does a fairly simple unordered search of the classpath; it only uses Class.forName() to load things, not actually querying the classloader; so the results are not necessarily definitive nor will it find all problems related to environment setup. Also, you should avoid calling this in deployed production code, both because it is quite slow and because it forces classes to get loaded.


Field Summary
static java.lang.String CLASS_NOTPRESENT
          Marker that a class or .jar was not found.
static java.lang.String CLASS_PRESENT
          Marker that a class or .jar was found.
static java.lang.String ERROR
          Prefixed to hash keys that signify potential problems.
static java.lang.String FOUNDCLASSES
          Prefixed to hash keys that signify .jars found in classpath.
 java.lang.String[] jarNames
          Listing of common .jar files that include Xalan-related classes.
static java.lang.String VERSION
          Prefixed to hash keys that signify version numbers.
 
Constructor Summary
EnvironmentCheck()
           
 
Method Summary
 boolean checkEnvironment(java.io.PrintWriter pw)
          Report on basic environment settings that affect Xalan.
static void main(java.lang.String[] args)
          Command line runnability: checks for [-out outFilename] arg.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final java.lang.String ERROR
Prefixed to hash keys that signify potential problems.

VERSION

public static final java.lang.String VERSION
Prefixed to hash keys that signify version numbers.

FOUNDCLASSES

public static final java.lang.String FOUNDCLASSES
Prefixed to hash keys that signify .jars found in classpath.

CLASS_PRESENT

public static final java.lang.String CLASS_PRESENT
Marker that a class or .jar was found.

CLASS_NOTPRESENT

public static final java.lang.String CLASS_NOTPRESENT
Marker that a class or .jar was not found.

jarNames

public java.lang.String[] jarNames
Listing of common .jar files that include Xalan-related classes.
Constructor Detail

EnvironmentCheck

public EnvironmentCheck()
Method Detail

main

public static void main(java.lang.String[] args)
Command line runnability: checks for [-out outFilename] arg.
Parameters:
args - command line args

checkEnvironment

public boolean checkEnvironment(java.io.PrintWriter pw)
Report on basic environment settings that affect Xalan. Note that this class is not advanced enough to tell you everything about the environment that affects Xalan, and sometimes reports errors that will not actually affect Xalan's behavior. Currently, it very simplistically checks the JVM's environment for some basic properties and logs them out; it will report a problem if it finds a setting or .jar file that is likely to cause problems. Advanced users can peruse the code herein to help them investigate potential environment problems found; other users may simply send the output from this tool along with any bugs they submit to help us in the debugging process.
Parameters:
pw - PrintWriter to send output to; can be sent to a file that will look similar to a Properties file; defaults to System.out if null
Returns:
true if your environment appears to have no major problems; false if potential environment problems found


Copyright © 2000 Apache XML Project. All Rights Reserved.