";
String HR = " ";
String pepperImg = "";
/**
* The main method of this JSP
*/
public void main(HttpServletRequest request, HttpSession session, JspWriter out) throws Exception {
this.request = request;
this.session = session;
this.out = out;
// out.print("openejb.home = " + System.getProperty("openejb.home") + "
");
try {
out.print(HR);
out.print("
");
// The openejb.home must be set
out.print("
openejb.home is set
");
String homePath = System.getProperty("openejb.home");
if (homePath == null) handleError(NO_HOME, INSTRUCTIONS);
out.print(OK);
// The openejb.home must exist
out.print("
openejb.home exists
");
File openejbHome = new File(homePath);
if (!openejbHome.exists()) handleError(BAD_HOME + homePath, NOT_THERE, INSTRUCTIONS);
out.print(OK);
// The openejb.home must be a directory
out.print("
openejb.home is a directory
");
if (!openejbHome.isDirectory()) handleError(BAD_HOME + homePath, NOT_DIRECTORY, INSTRUCTIONS);
out.print(OK);
// The openejb.home must contain a 'lib' directory
out.print("
has lib directory
");
File openejbHomeLib;
if (TomcatVersion.v6.isTheVersion() || TomcatVersion.v7.isTheVersion()) {
openejbHomeLib = new File(openejbHome, "lib");
} else {
File common = new File(openejbHome, "common");
openejbHomeLib = new File(common, "lib");
}
if (!openejbHomeLib.exists()) handleError(BAD_HOME + homePath, NO_LIB, INSTRUCTIONS);
out.print(OK);
// // The openejb.home there must be openejb*.jar files in the 'lib' directory
// out.print("
has openejb* libraries
");
// String[] libs = openejbHomeLib.list();
// boolean found = false;
// for (int i = 0; i < libs.length && !found; i++) {
// found = (libs[i].startsWith("openejb-") && libs[i].endsWith(".jar"));
// }
// if (!found) handleError(BAD_HOME + homePath, NO_LIBS, INSTRUCTIONS);
// out.print(OK);
out.print("
");
} catch (Exception e) {
out.print(FAIL);
out.print("");
out.print(HR);
out.print(e.getMessage());
}
}
String NO_HOME = "The openejb.home is not set.";
String BAD_HOME = "Invalid openejb.home: ";
String NOT_THERE = "The path specified does not exist.";
String NOT_DIRECTORY = "The path specified is not a directory.";
String NO_LIB = "The path specified is not correct, it does not contain a 'lib' directory.";
String NO_LIBS = "The path specified is not correct, it does not contain any OpenEJB libraries.";
String INSTRUCTIONS = "Please edit the web.xml of the openejb_loader webapp and set the openejb.home init-param to the full path where OpenEJB is installed.";
private void handleError(String m1, String m2, String m3) throws Exception {
String msg = " Please Fix: