Author: mwringe
Date: 2012-02-03 11:35:42 -0500 (Fri, 03 Feb 2012)
New Revision: 8397
Modified:
components/wci/trunk/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
components/wci/trunk/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
components/wci/trunk/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
Log:
GTNWCI-32: Check when manually unregisting a web application that the
ServletContainerContext hasn't already been stopped (and hence its registration has
been destroyed). Fixes an NPE exception when the server currently shutsdown.
Modified:
components/wci/trunk/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java
===================================================================
---
components/wci/trunk/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java 2012-02-03
16:17:58 UTC (rev 8396)
+++
components/wci/trunk/jboss/jboss6/src/main/java/org/gatein/wci/jboss/JB6ServletContainerContext.java 2012-02-03
16:35:42 UTC (rev 8397)
@@ -436,7 +436,15 @@
@Override
public void unregisterWebApp(ServletContext servletContext)
{
- this.manualMonitoredContexts.remove(servletContext.getServletContextName());
- registration.unregisterWebApp(servletContext.getContextPath());
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
}
}
Modified:
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java
===================================================================
---
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2012-02-03
16:17:58 UTC (rev 8396)
+++
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6ServletContainerContext.java 2012-02-03
16:35:42 UTC (rev 8397)
@@ -361,8 +361,16 @@
@Override
public void unregisterWebApp(ServletContext servletContext)
{
- this.manualMonitoredContexts.remove(servletContext.getServletContextName());
- registration.unregisterWebApp(servletContext.getContextPath());
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
}
}
Modified:
components/wci/trunk/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
===================================================================
---
components/wci/trunk/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2012-02-03
16:17:58 UTC (rev 8396)
+++
components/wci/trunk/tomcat/tomcat6/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2012-02-03
16:35:42 UTC (rev 8397)
@@ -419,7 +419,15 @@
@Override
public void unregisterWebApp(ServletContext servletContext)
{
- this.manualMonitoredContexts.remove(servletContext.getServletContextName());
- registration.unregisterWebApp(servletContext.getContextPath());
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
}
}
Modified:
components/wci/trunk/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java
===================================================================
---
components/wci/trunk/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2012-02-03
16:17:58 UTC (rev 8396)
+++
components/wci/trunk/tomcat/tomcat7/src/main/java/org/gatein/wci/tomcat/TC7ServletContainerContext.java 2012-02-03
16:35:42 UTC (rev 8397)
@@ -440,7 +440,15 @@
@Override
public void unregisterWebApp(ServletContext servletContext)
{
- this.manualMonitoredContexts.remove(servletContext.getServletContextName());
- registration.unregisterWebApp(servletContext.getContextPath());
+ if (isDisabledNativeRegistration(servletContext))
+ {
+ this.manualMonitoredContexts.remove(servletContext.getServletContextName());
+ //if the registration is null, then this ServletContainerContext has been stopped
already
+ //and all the registrations have already been removed.
+ if (registration != null)
+ {
+ registration.unregisterWebApp(servletContext.getContextPath());
+ }
+ }
}
}
Show replies by date