application.setClassLoader(cl);
return application;
}
try {
String moduleDir = getLocation(modId);
EjbArchivist ejbArchivist = new EjbArchivist();
ejbArchivist.setXMLValidation(validateXml);
// We need to use a temp CL until we are done with validate(),
// see https://glassfish.dev.java.net/issues/show_bug.cgi?id=223
ClassLoader tcl = (cl instanceof InstrumentableClassLoader) ?
InstrumentableClassLoader.class.cast(cl).copy() : cl;
ejbArchivist.setClassLoader(tcl);
FileArchive archive = openDDArchive(modId, moduleDir);
// Try to load the app from the serialized descriptor file.
SerializedDescriptorHelper.Loader sdLoader =