You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sh...@lotus.com on 2001/04/26 21:42:18 UTC
XJ2: EnvironmentCheck.java self-checker updated
I've updated EnvironmentCheck to also look in your java.ext.dirs directory
for .jar files (JDK 1.2+) and to look for various XSLTC-related .jars as
well. Note that this class is compilable standalone if you wish to use it
independently from Xalan as well.
To just see the latest source without having to use CVS:
http://xml.apache.org/websrc/cvsweb.cgi/xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.java?rev=1.3&content-type=text/vnd.viewcvs-markup
----
This hackish yet nifty utility will report out on some common Java
classpath/environment problems that have come up on the list frequently.
My eventual goal is to enable users to determine if problems
they find are likely due to something in the environment not being correct,
or if it's really a bug in Xalan or another properly used component (namely
a parser like Xerces).
Currently the utility is a little simplistic, but it should provide some
debugging info that users could also attach to Bugzilla reports if they
think it might be showing an environment problem.
EnvironmentCheck can be used from either the command line or from your
application. Note that when debugging server-based apps, it's *very*
important to run this from inside your application, since servlet engines
and the like change around your classpath under the covers. Just leave
this call out in your production version.
Either:
java org.apache.xalan.xslt.EnvironmentCheck [-out outFileName]
Or:
{
PrintWriter pw = new PrintWriter(wherever-you-want-output);
(new org.apache.xalan.xslt.EnvironmentCheck()).checkEnvironment(pw);
}
A basic report on .jar files found and version numbers, etc. will be sent
either to the console or the supplied filename/printwriter. Any output
with 'ERROR' in it is likely a problem with your environment (although not
necessarily - see code comments: I don't completely check classpath order,
etc.)
I'd appreciate both comments on this utility specifically and on techniques
for building product environment self-testers like this, that end users use
to check their own setups.
- Shane, Xalan test & automation