|
| | | | I'm getting a NoClassDefFound error. What has to be on the classpath? | | | | |
| |
- xalan.jar and xerces.jar (or the XML parser you are using) must always be on the classpath.
- To run the samples in the samples subdirectories, xalansamples.jar must be on the classpath. To run the servlet (in
samples/servlet), xalanservlet.jar must be on the classpath along with the javax.servlet and javax.servlet.http packages. Sun distributes
the javax.servlet packages in the JSWDK servlet.jar file.
- To run extensions (including the samples in samples/extensions), bsf.jar, and bsfengines.jar must be on the
classpath. To run extensions implemented in JavaScript, js.jar must also be on the classpath. For information on what
you need to run extensions implemented in other scripting languages, see Supported languages.
- To run applications that use the Xalan-Java version 1 API, you must put xalanj1compat.jar on the classpath, recompile the application,
and be sure xalanj1compat.jar is on the classpath at run time (see Using the Xalan-Java version 1
API).
For more information, see Setting up the system classpath.
Using the EnvironmentCheck utility: To help diagnose classpath problems, try running Xalan's environment checking utility, checked in at
xml-xalan/java/src/org/apache/xalan/xslt/EnvironmentCheck.
You can run this utility from the command line as follows:
java org.apache.xalan.xslt.EnvironmentCheck [-out outFile]
You can also call this utility from within your application. For example,
boolean environmentOK = (new EnvironmentCheck()).checkEnvironment (yourPrintWriter);
Be sure to run EnvironmentCheck in the environment where you are experiencing the problem. For example, if you get a
NoClassDefFound error from a command-line application, run EnvironmentCheck on the command line with exactly the same
classpath. If the error occurs inside your Java application (or in a servlet, etc.), be sure to call the
EnvironmentCheck checkEnvironment(...) method from within your running application.
|
|