Author: fmeschbe
Date: Tue Nov  4 08:49:51 2008
New Revision: 711307

URL: http://svn.apache.org/viewvc?rev=711307&view=rev
Log:
SLING-530 log NullPointerExceptions which might occurr on shutdown
when running in an external servlet container using the Equinox
bridge at debug only

Modified:
    
incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java

Modified: 
incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java
URL: 
http://svn.apache.org/viewvc/incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java?rev=711307&r1=711306&r2=711307&view=diff
==============================================================================
--- 
incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java
 (original)
+++ 
incubator/sling/trunk/scripting/jsp/src/main/java/org/apache/sling/scripting/jsp/JspScriptEngineFactory.java
 Tue Nov  4 08:49:51 2008
@@ -232,7 +232,13 @@
         }
 
         if (jspRuntimeContext != null) {
-            jspRuntimeContext.destroy();
+            try {
+                jspRuntimeContext.destroy();
+            } catch (NullPointerException npe) {
+                // SLING-530, might be thrown on system shutdown in a servlet
+                // container when using the Equinox servlet container bridge
+                log.debug("deactivate: ServletContext might already be 
unavailable", npe);
+            }
             jspRuntimeContext = null;
         }
 
@@ -251,7 +257,9 @@
         try {
             
slingServletContext.removeAttribute(JspApplicationContextImpl.class.getName());
         } catch (NullPointerException npe) {
-            log.error("deactivate: Caught NullPointerException ! Just 
logging", npe);
+            // SLING-530, might be thrown on system shutdown in a servlet
+            // container when using the Equinox servlet container bridge
+            log.debug("deactivate: ServletContext might already be 
unavailable", npe);
         }
     }
 


Reply via email to