You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2006/02/20 18:45:49 UTC

svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Author: remm
Date: Mon Feb 20 09:45:48 2006
New Revision: 379183

URL: http://svn.apache.org/viewcvs?rev=379183&view=rev
Log:
- Slightly modify the timing of the manager start (unfortunately, setManager in ContextConfig.java 
  causes and immediate start of the manager).

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java?rev=379183&r1=379182&r2=379183&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java (original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java Mon Feb 20 09:45:48 2006
@@ -81,6 +81,7 @@
 import org.apache.catalina.deploy.SecurityCollection;
 import org.apache.catalina.deploy.SecurityConstraint;
 import org.apache.catalina.loader.WebappLoader;
+import org.apache.catalina.session.StandardManager;
 import org.apache.catalina.startup.ContextConfig;
 import org.apache.catalina.startup.TldConfig;
 import org.apache.catalina.util.CharsetMapper;
@@ -4116,6 +4117,20 @@
                 // Notify our interested LifecycleListeners
                 lifecycle.fireLifecycleEvent(START_EVENT, null);
 
+                // Configure default manager if none was specified
+                if (manager == null) {
+                    if ((cluster != null) && distributable) {
+                        try {
+                            setManager(cluster.createManager(getName()));
+                        } catch (Exception ex) {
+                            log.error("standardContext.clusterFail", ex);
+                            ok = false;
+                        }
+                    } else {
+                        setManager(new StandardManager());
+                    }
+                }
+                
                 // Start manager
                 if ((manager != null) && (manager instanceof Lifecycle)) {
                     ((Lifecycle) getManager()).start();

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java?rev=379183&r1=379182&r2=379183&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java Mon Feb 20 09:45:48 2006
@@ -388,28 +388,6 @@
 
 
     /**
-     * Set up a manager.
-     */
-    protected synchronized void managerConfig() {
-
-        if (context.getManager() == null) {
-            if ((context.getCluster() != null) && context.getDistributable()) {
-                try {
-                    context.setManager(context.getCluster().createManager
-                                       (context.getName()));
-                } catch (Exception ex) {
-                    log.error("contextConfig.clusteringInit", ex);
-                    ok = false;
-                }
-            } else {
-                context.setManager(new StandardManager());
-            }
-        }
-
-    }
-
-
-    /**
      * Set up an Authenticator automatically if required, and one has not
      * already been configured.
      */
@@ -1062,10 +1040,6 @@
         // Configure an authenticator if we need one
         if (ok)
             authenticatorConfig();
-
-        // Configure a manager
-        if (ok)
-            managerConfig();
 
         // Dump the contents of this pipeline if requested
         if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Remy Maucherat <re...@apache.org>.
Filip Hanik - Dev Lists wrote:
> here is the trace
> 
> Name=/replicator
> Manager=null
> Cluster=null
> Distributable=true
> 
> as you can see, the cluster reference is null at this point in time.

Yeah, well, I guess I should be using getCluster then (I simplified the 
code too much when moving it over).

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
here is the trace

Name=/replicator
Manager=null
Cluster=null
Distributable=true

as you can see, the cluster reference is null at this point in time.

Filip


Filip Hanik - Dev Lists wrote:
> ok, I will dig to the bottom of this :)
>
> Filip
>
> Remy Maucherat wrote:
>> Filip Hanik - Dev Lists wrote:
>>> I reverted the checkin on my local box, and it started to work 
>>> again, do you want to handle it, or do you need me to provide you 
>>> with more info what the actual cause was?
>>
>> I have no idea what the problem is. I added tracing, and verified the 
>> manager instance was null (in the default case at least) when getting 
>> to:
>>                 if (manager == null) {
>>                     if ((cluster != null) && distributable) {
>>                         try {
>>                             
>> setManager(cluster.createManager(getName()));
>>                         } catch (Exception ex) {
>>                             log.error("standardContext.clusterFail", 
>> ex);
>>                             ok = false;
>>                         }
>>                     } else {
>>                         setManager(new StandardManager());
>>                     }
>>                 }
>>
>> So it should call createManager.
>>
>> Rémy
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: dev-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
ok, I will dig to the bottom of this :)

Filip

Remy Maucherat wrote:
> Filip Hanik - Dev Lists wrote:
>> I reverted the checkin on my local box, and it started to work again, 
>> do you want to handle it, or do you need me to provide you with more 
>> info what the actual cause was?
>
> I have no idea what the problem is. I added tracing, and verified the 
> manager instance was null (in the default case at least) when getting to:
>                 if (manager == null) {
>                     if ((cluster != null) && distributable) {
>                         try {
>                             setManager(cluster.createManager(getName()));
>                         } catch (Exception ex) {
>                             log.error("standardContext.clusterFail", ex);
>                             ok = false;
>                         }
>                     } else {
>                         setManager(new StandardManager());
>                     }
>                 }
>
> So it should call createManager.
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Remy Maucherat <re...@apache.org>.
Filip Hanik - Dev Lists wrote:
> I reverted the checkin on my local box, and it started to work again, do 
> you want to handle it, or do you need me to provide you with more info 
> what the actual cause was?

I have no idea what the problem is. I added tracing, and verified the 
manager instance was null (in the default case at least) when getting to:
                 if (manager == null) {
                     if ((cluster != null) && distributable) {
                         try {
                             setManager(cluster.createManager(getName()));
                         } catch (Exception ex) {
                             log.error("standardContext.clusterFail", ex);
                             ok = false;
                         }
                     } else {
                         setManager(new StandardManager());
                     }
                 }

So it should call createManager.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
I reverted the checkin on my local box, and it started to work again, do 
you want to handle it, or do you need me to provide you with more info 
what the actual cause was?

Filip


Remy Maucherat wrote:
> Filip Hanik - Dev Lists wrote:
>> Gentlemen, I am running into a problem right now where the manager 
>> for a distributable webapp is the StandardManager, instead of the 
>> CatalinaCluster.createManager result when the cluster is enabled. I 
>> have a feeling the commit below might be related.
>> I will continue to debug, but if you could shed some light on it in 
>> the meantime, it may shorten my time trying to figure it out.
>
> It's possible, I don't know. It would be strange though: the manager 
> is set right after where it used to be.
>
> Rémy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Remy Maucherat <re...@apache.org>.
Filip Hanik - Dev Lists wrote:
> Gentlemen, I am running into a problem right now where the manager for a 
> distributable webapp is the StandardManager, instead of the 
> CatalinaCluster.createManager result when the cluster is enabled. I have 
> a feeling the commit below might be related.
> I will continue to debug, but if you could shed some light on it in the 
> meantime, it may shorten my time trying to figure it out.

It's possible, I don't know. It would be strange though: the manager is 
set right after where it used to be.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: svn commit: r379183 - in /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina: core/StandardContext.java startup/ContextConfig.java

Posted by Filip Hanik - Dev Lists <de...@hanik.com>.
Gentlemen, I am running into a problem right now where the manager for a 
distributable webapp is the StandardManager, instead of the 
CatalinaCluster.createManager result when the cluster is enabled. I have 
a feeling the commit below might be related.
I will continue to debug, but if you could shed some light on it in the 
meantime, it may shorten my time trying to figure it out.

Filip



remm@apache.org wrote:
> Author: remm
> Date: Mon Feb 20 09:45:48 2006
> New Revision: 379183
>
> URL: http://svn.apache.org/viewcvs?rev=379183&view=rev
> Log:
> - Slightly modify the timing of the manager start (unfortunately, setManager in ContextConfig.java 
>   causes and immediate start of the manager).
>
> Modified:
>     tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
>     tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
>
> Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java
> URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java?rev=379183&r1=379182&r2=379183&view=diff
> ==============================================================================
> --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java (original)
> +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/core/StandardContext.java Mon Feb 20 09:45:48 2006
> @@ -81,6 +81,7 @@
>  import org.apache.catalina.deploy.SecurityCollection;
>  import org.apache.catalina.deploy.SecurityConstraint;
>  import org.apache.catalina.loader.WebappLoader;
> +import org.apache.catalina.session.StandardManager;
>  import org.apache.catalina.startup.ContextConfig;
>  import org.apache.catalina.startup.TldConfig;
>  import org.apache.catalina.util.CharsetMapper;
> @@ -4116,6 +4117,20 @@
>                  // Notify our interested LifecycleListeners
>                  lifecycle.fireLifecycleEvent(START_EVENT, null);
>  
> +                // Configure default manager if none was specified
> +                if (manager == null) {
> +                    if ((cluster != null) && distributable) {
> +                        try {
> +                            setManager(cluster.createManager(getName()));
> +                        } catch (Exception ex) {
> +                            log.error("standardContext.clusterFail", ex);
> +                            ok = false;
> +                        }
> +                    } else {
> +                        setManager(new StandardManager());
> +                    }
> +                }
> +                
>                  // Start manager
>                  if ((manager != null) && (manager instanceof Lifecycle)) {
>                      ((Lifecycle) getManager()).start();
>
> Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
> URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java?rev=379183&r1=379182&r2=379183&view=diff
> ==============================================================================
> --- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java (original)
> +++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/startup/ContextConfig.java Mon Feb 20 09:45:48 2006
> @@ -388,28 +388,6 @@
>  
>  
>      /**
> -     * Set up a manager.
> -     */
> -    protected synchronized void managerConfig() {
> -
> -        if (context.getManager() == null) {
> -            if ((context.getCluster() != null) && context.getDistributable()) {
> -                try {
> -                    context.setManager(context.getCluster().createManager
> -                                       (context.getName()));
> -                } catch (Exception ex) {
> -                    log.error("contextConfig.clusteringInit", ex);
> -                    ok = false;
> -                }
> -            } else {
> -                context.setManager(new StandardManager());
> -            }
> -        }
> -
> -    }
> -
> -
> -    /**
>       * Set up an Authenticator automatically if required, and one has not
>       * already been configured.
>       */
> @@ -1062,10 +1040,6 @@
>          // Configure an authenticator if we need one
>          if (ok)
>              authenticatorConfig();
> -
> -        // Configure a manager
> -        if (ok)
> -            managerConfig();
>  
>          // Dump the contents of this pipeline if requested
>          if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org