Application app = configManager.getExtensionDescriptor(
em.getName(), em.getLocation(), true);
RoleMapper.removeRoleMapper(app.getRoleMapper().getName());
appName = app.getRegistrationName();
} catch (Exception ce) {
throw new Exception(ce);
}
String contextRoot = null;
ElementProperty ep = em.getElementPropertyByName("contextRoot");
if(ep != null ){
contextRoot = ep.getValue();
} else {
contextRoot = em.getName();
}
String virtualServers = null;
try {
virtualServers = configManager.getVirtualServers(em.getName());
} catch(Exception ce) {
throw new Exception("Exception getting virtual servers by app name "
+ appName, ce);
}
try {
getWebContainer().unloadWebModule(contextRoot, appName,
virtualServers, wbd);
// XXX : Fix me
return true;
} catch (Exception ex) {
_logger.log(Level.WARNING,"Exception thrown in the unload" + ex.toString());
return false;
} finally {
try {
Switch.getSwitch().getNamingManager().unbindObjects(wbd);
} catch (javax.naming.NamingException nameEx) {
throw new Exception("[WebExtensionLoader] "
+ " Exception during namingManager.unbindObject",
nameEx);
}
}