openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r1677958 - /openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Date Wed, 06 May 2015 10:50:04 GMT
Author: struberg
Date: Wed May  6 10:50:03 2015
New Revision: 1677958

URL: http://svn.apache.org/r1677958
Log:
OWB-1050 ServletContext can be null in certain integration cases

Modified:
    openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java

Modified: openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java?rev=1677958&r1=1677957&r2=1677958&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
(original)
+++ openwebbeans/trunk/webbeans-web/src/main/java/org/apache/webbeans/web/context/WebContextsService.java
Wed May  6 10:50:03 2015
@@ -494,8 +494,10 @@ public class WebContextsService extends
         // Destroy context
         if (context != null && context.isActive())
         {
+            // we need to mark the conversation to get destroyed at the end of the request
+            ServletRequestContext requestContext = getRequestContext(true);
 
-            if (destroySessionImmediately)
+            if (destroySessionImmediately || requestContext == null)
             {
                 context.destroy();
                 webBeansContext.getBeanManagerImpl().fireEvent(session != null ? session
: new Object(), DestroyedLiteral.INSTANCE_SESSION_SCOPED);
@@ -506,8 +508,6 @@ public class WebContextsService extends
             }
             else
             {
-                // we need to mark the conversation to get destroyed at the end of the request
-                ServletRequestContext requestContext = getRequestContext(true);
                 requestContext.setPropagatedSessionContext(context);
             }
         }



Mime
View raw message