logger.error("Unable to add faces config modules in " + standardContext.getPath() + ": Exception: " + e1.getMessage(), e1);
// TODO :kmalhi:: Remove stack trace after testing
e1.printStackTrace();
}
// Add all Tomcat env entries to context so they can be overriden by the env.properties file
NamingResources naming = standardContext.getNamingResources();
for (ContextEnvironment environment : naming.findEnvironments()) {
EnvEntry envEntry = webApp.getEnvEntryMap().get(environment.getName());
if (envEntry == null) {
envEntry = new EnvEntry();
envEntry.setName(environment.getName());
webApp.getEnvEntry().add(envEntry);
}
envEntry.setEnvEntryValue(environment.getValue());
envEntry.setEnvEntryType(environment.getType());
}
// process the annotations
try {
AnnotationDeployer annotationDeployer = new AnnotationDeployer();
annotationDeployer.deploy(webModule);
} catch (OpenEJBException e) {
logger.error("Unable to process annotation in " + standardContext.getPath() + ": Exception: " + e.getMessage(), e);
}
// remove all jndi entries where there is a configured Tomcat resource or resource-link
webApp = webModule.getWebApp();
for (ContextResource resource : naming.findResources()) {
String name = resource.getName();
removeRef(webApp, name);
}
for (ContextResourceLink resourceLink : naming.findResourceLinks()) {
String name = resourceLink.getName();
removeRef(webApp, name);
}
// remove all env entries from the web xml that are not overridable
for (ContextEnvironment environment : naming.findEnvironments()) {
if (!environment.getOverride()) {
// overrides are not allowed
webApp.getEnvEntryMap().remove(environment.getName());
}
}