Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2013-07-19 04:02:23 -0400
committerJan Bartel2013-07-19 04:02:23 -0400
commitecd687db6d99728392f71f02b489964bae8c4a92 (patch)
tree0cfe55f01460c6fbf3c081af3143a1f2d540dacc /jetty-plus
parentd65b511447b5788de1e2d0de2592eea2ac75cb03 (diff)
downloadorg.eclipse.jetty.project-ecd687db6d99728392f71f02b489964bae8c4a92.tar.gz
org.eclipse.jetty.project-ecd687db6d99728392f71f02b489964bae8c4a92.tar.xz
org.eclipse.jetty.project-ecd687db6d99728392f71f02b489964bae8c4a92.zip
413034 Multiple webapps redeploy returns NamingException with AppDynamics javaagent
Diffstat (limited to 'jetty-plus')
-rw-r--r--jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java
index 660231d9f2..26227f1555 100644
--- a/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java
+++ b/jetty-plus/src/main/java/org/eclipse/jetty/plus/webapp/EnvConfiguration.java
@@ -31,6 +31,7 @@ import javax.naming.Name;
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
+import org.eclipse.jetty.jndi.ContextFactory;
import org.eclipse.jetty.jndi.NamingContext;
import org.eclipse.jetty.jndi.NamingUtil;
import org.eclipse.jetty.jndi.local.localContextRoot;
@@ -147,6 +148,7 @@ public class EnvConfiguration extends AbstractConfiguration
//get rid of any bindings for comp/env for webapp
ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(context.getClassLoader());
+ ContextFactory.associateClassLoader(context.getClassLoader());
try
{
Context ic = new InitialContext();
@@ -170,6 +172,7 @@ public class EnvConfiguration extends AbstractConfiguration
}
finally
{
+ ContextFactory.disassociateClassLoader();
Thread.currentThread().setContextClassLoader(oldLoader);
}
}
@@ -251,6 +254,7 @@ public class EnvConfiguration extends AbstractConfiguration
{
ClassLoader old_loader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(wac.getClassLoader());
+ ContextFactory.associateClassLoader(wac.getClassLoader());
try
{
Context context = new InitialContext();
@@ -259,8 +263,9 @@ public class EnvConfiguration extends AbstractConfiguration
}
finally
{
- Thread.currentThread().setContextClassLoader(old_loader);
- }
+ ContextFactory.disassociateClassLoader();
+ Thread.currentThread().setContextClassLoader(old_loader);
+ }
}
private static class Bound

Back to the top