Revision: 15420
Author: [email protected]
Date: Fri Nov 19 11:19:01 2010
Log: [No log message]
http://code.google.com/p/mobicents/source/detail?r=15420

Modified:
/branches/servers/sip-servlets/2.0/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContext.java

=======================================
--- /branches/servers/sip-servlets/2.0/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContext.java Thu Nov 18 15:10:03 2010 +++ /branches/servers/sip-servlets/2.0/tomcat-7/src/main/java/org/mobicents/servlet/sip/startup/SipStandardContext.java Fri Nov 19 11:19:01 2010
@@ -64,6 +64,7 @@
 import org.apache.catalina.deploy.LoginConfig;
 import org.apache.catalina.deploy.NamingResources;
 import org.apache.catalina.loader.WebappLoader;
+import org.apache.catalina.util.ExtensionValidator;
 import org.apache.log4j.Logger;
 import org.apache.naming.resources.FileDirContext;
 import org.apache.naming.resources.WARDirContext;
@@ -289,6 +290,9 @@
                if( this.getState().equals(LifecycleState.INITIALIZED)) {
                        prepareServletContext();
                }
+
+               super.setConfigured(false);
+
                // Add missing components as necessary
         if (getResources() == null) {   // (1) Required by Loader
             if (logger.isDebugEnabled())
@@ -296,6 +300,10 @@
             try {
if ((getDocBase() != null) && (getDocBase().endsWith(".sar")) && (!(new File(getBasePath())).isDirectory()))
                     setResources(new SARDirContext());
+ else if ((getDocBase() != null) && (getDocBase().endsWith(".war")) && (!(new File(getBasePath())).isDirectory()))
+                    setResources(new WARDirContext());
+                else
+                    setResources(new FileDirContext());
             } catch (IllegalArgumentException e) {
logger.error("Error initializing resources: " + e.getMessage());
 //                ok = false;
@@ -305,12 +313,25 @@
         if (!resourcesStart()) {
             logger.error( "Error in resourceStart()");
         }
-
+
         if (getLoader() == null) {
WebappLoader webappLoader = new WebappLoader(getParentClassLoader());
             webappLoader.setDelegate(getDelegate());
             setLoader(webappLoader);
         }
+
+        // Post work directory
+        postWorkDirectory();
+
+        boolean dependencyCheck = true;
+        try {
+            dependencyCheck = ExtensionValidator.validateApplication
+                (getResources(), this);
+        } catch (IOException ioe) {
+            logger.error("Error in dependencyCheck", ioe);
+            dependencyCheck = false;
+        }
+

         // Configure default manager if none was specified
         if (manager == null) {
@@ -344,6 +365,12 @@
                }

             // Start our subordinate components, if any
+
+            if ((loader != null) && (loader instanceof Lifecycle))
+                ((Lifecycle) loader).start();
+
+            if ((resources != null) && (resources instanceof Lifecycle))
+                ((Lifecycle) resources).start();

 //             fireLifecycleEvent(Lifecycle.CONFIGURE_START_EVENT, null);

@@ -379,14 +406,7 @@
                //and call load on startup which is equivalent to
//JSR 289 Section 2.1.1 Step 2.Invoke servlet.init(), the initialization method on the Servlet. Invoke the init() on all the load-on-startup Servlets in the application

-        // Post work directory
-        postWorkDirectory();
-
-        if ((loader != null) && (loader instanceof Lifecycle))
-            ((Lifecycle) loader).start();
-
-        if ((resources != null) && (resources instanceof Lifecycle))
-            ((Lifecycle) resources).start();
+
 //
 //        fireLifecycleEvent(Lifecycle.CONFIGURE_START_EVENT, null);

Reply via email to