Author: ate
Date: Wed May 11 15:25:01 2011
New Revision: 1101922

URL: http://svn.apache.org/viewvc?rev=1101922&view=rev
Log:
JS2-1183: Tomcat 6.0.24+ SEVERE errors logged from 
org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap 
- (only) fixing the clearing of JetspeedVelocityViewServlet created ThreadLocal 
for the VelocityContext using new ServletRequestCleanupService from JS2-1253

Modified:
    
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java

Modified: 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java?rev=1101922&r1=1101921&r2=1101922&view=diff
==============================================================================
--- 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
 (original)
+++ 
portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/velocity/JetspeedVelocityViewServlet.java
 Wed May 11 15:25:01 2011
@@ -51,6 +51,7 @@ import org.apache.jetspeed.locator.Templ
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
 import org.apache.jetspeed.request.RequestContext;
+import org.apache.jetspeed.util.ServletRequestThreadLocalCleanupCallback;
 import org.apache.portals.bridges.velocity.BridgesVelocityViewServlet;
 import org.apache.velocity.Template;
 import org.apache.velocity.app.VelocityEngine;
@@ -176,7 +177,7 @@ public class JetspeedVelocityViewServlet
         // initialize velocity engine cache validation interval
         cacheValidationInterval = getLongInitParameter(config, 
CACHE_VALIDATION_INTERVAL_PARAMETER, DEFAULT_CACHE_VALIDATION_INTERVAL);
     }
-
+    
     /**
      * overriding VelocityViewServlet initialization of global Velocity to 
properly provide our own velocity.properties
      * so to prevent an ERROR logging for not finding the default global 
VM_global_library.vm (which isn't available).
@@ -244,6 +245,7 @@ public class JetspeedVelocityViewServlet
             throw new IllegalStateException("JetspeedVelocityViewServlet 
unable to handle request because there is no RequestContext in "+
                    "the HttpServletRequest.");
         }
+        new ServletRequestThreadLocalCleanupCallback(handlingRequestContext);
         
         // hook up eventHandlers to the context, specifically our own 
IgnoringNullSetEventHandling
         eventCartridge.attachToContext(ctx);
@@ -256,7 +258,7 @@ public class JetspeedVelocityViewServlet
             ctx.put("JS2RequestContext", requestContext);
             
             // setup TLS for Context propagation
-            handlingRequestContext.set(ctx);            
+            handlingRequestContext.set(ctx);    
             return super.handleRequest(request, response, ctx);            
         }
         // configure velocity context



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscr...@portals.apache.org
For additional commands, e-mail: jetspeed-dev-h...@portals.apache.org

Reply via email to