Permalink
Browse files

Merge pull request #288 from hadashi/1.2.x

Play nicely with servlet containers class loader.
  • Loading branch information...
2 parents 711eb01 + b90a677 commit c9b803b1cfd5fe666abe8ea3a4077d453a7015bf @guillaumebort guillaumebort committed Aug 25, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 framework/src/play/server/ServletWrapper.java
@@ -62,6 +62,7 @@
private static boolean routerInitializedWithContext = false;
public void contextInitialized(ServletContextEvent e) {
+ ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
String appDir = e.getServletContext().getRealPath("/WEB-INF/application");
File root = new File(appDir);
final String playId = e.getServletContext().getInitParameter("play.id");
@@ -81,6 +82,8 @@ public void contextInitialized(ServletContextEvent e) {
if (isGreaterThan(e.getServletContext(), 2, 4)) {
loadRouter(e.getServletContext().getContextPath());
}
+
+ Thread.currentThread().setContextClassLoader(oldClassLoader);
}
public void contextDestroyed(ServletContextEvent e) {

0 comments on commit c9b803b

Please sign in to comment.