Index: 
D:/DEV/Projects/Tuscany/source/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java
===================================================================
--- 
D:/DEV/Projects/Tuscany/source/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java
  (revision 409912)
+++ 
D:/DEV/Projects/Tuscany/source/java/sca/tomcat/src/main/java/org/apache/tuscany/tomcat/TuscanyContextListener.java
  (working copy)
@@ -138,15 +138,18 @@
     private void stopContext(Context ctx) {
         if (moduleContext != null) {
             moduleContext.publish(new ModuleStop(this));
+
+            CompositeContext rootContext = runtime.getRootContext();
+            if(rootContext != null){
+                rootContext.removeContext(moduleContext.getName());
+            }
+            valve.setEnabled(false);
+            //ctx.getPipeline().removeValve(valve);
+            //valve = null;
+            moduleContext.stop();
+            moduleContext = null;
+            // todo unload module component from runtime
         }
-        CompositeContext rootContext = runtime.getRootContext();
-        rootContext.removeContext(moduleContext.getName());
-        valve.setEnabled(false);
-        //ctx.getPipeline().removeValve(valve);
-        //valve = null;
-        moduleContext.stop();
-        moduleContext = null;
-        // todo unload module component from runtime
     }
 
 }
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to