456426 Exception on context undeploy from EnvConfiguration

This commit is contained in:
Jan Bartel 2015-01-01 12:03:21 +01:00
parent 451e27e736
commit c92712779b
1 changed files with 4 additions and 10 deletions

View File

@ -185,26 +185,20 @@ public class EnvConfiguration extends AbstractConfiguration
@Override
public void destroy (WebAppContext context) throws Exception
{
ClassLoader old_loader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(context.getClassLoader());
ContextFactory.associateClassLoader(context.getClassLoader());
try
{
//unbind any NamingEntries that were configured in this webapp's name space
//unbind any NamingEntries that were configured in this webapp's name space
NamingContext scopeContext = (NamingContext)NamingEntryUtil.getContextForScope(context);
scopeContext.getParent().destroySubcontext(scopeContext.getName());
}
catch (NameNotFoundException e)
{
LOG.ignore(e);
LOG.debug("No naming entries configured in environment for webapp "+context);
LOG.debug("No jndi entries scoped to webapp {}", context);
}
finally
catch (NamingException e)
{
ContextFactory.disassociateClassLoader();
Thread.currentThread().setContextClassLoader(old_loader);
LOG.debug("Error unbinding jndi entries scoped to webapp "+context, e);
}
}