// Verify that "catalina.home" was passed. if (catalinaHome == null) {
log.error("Must set '" + Constants.CATALINA_HOME_PROP + "' system property");
System.exit(1);
}
// Process command line options int index = 0; while (true) { if (index == args.length) {
usage();
System.exit(1);
} if ("-ant".equals(args[index])) {
ant = true;
} elseif ("-common".equals(args[index])) {
common = true;
} elseif ("-server".equals(args[index])) {
server = true;
} elseif ("-shared".equals(args[index])) {
shared = true;
} else { break;
}
index++;
} if (index > args.length) {
usage();
System.exit(1);
}
// Set "ant.home" if requested if (ant) {
System.setProperty("ant.home", catalinaHome);
}
// Construct the class loader we will be using
ClassLoader classLoader = null; try {
List<File> packed = new ArrayList<>();
List<File> unpacked = new ArrayList<>();
unpacked.add(new File(catalinaHome, "classes"));
packed.add(new File(catalinaHome, "lib")); if (common) {
unpacked.add(new File(catalinaHome, "common" + File.separator + "classes"));
packed.add(new File(catalinaHome, "common" + File.separator + "lib"));
} if (server) {
unpacked.add(new File(catalinaHome, "server" + File.separator + "classes"));
packed.add(new File(catalinaHome, "server" + File.separator + "lib"));
} if (shared) {
unpacked.add(new File(catalinaHome, "shared" + File.separator + "classes"));
packed.add(new File(catalinaHome, "shared" + File.separator + "lib"));
}
classLoader =
ClassLoaderFactory.createClassLoader
(unpacked.toArray(new File[0]),
packed.toArray(new File[0]), null);
} catch (Throwable t) {
Bootstrap.handleThrowable(t);
log.error("Class loader creation threw exception", t);
System.exit(1);
} Thread.currentThread().setContextClassLoader(classLoader);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.