remm        2003/08/10 02:47:33

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  - Fix bug where welcome files were not being processed in the embedded
    distribution. This was caused by the fact that the context is already
    registered in JMX, while being not initialized yet. The context will be
    unregistered if already registered while not being started yet.
  
  Revision  Changes    Path
  1.82      +13 -9     
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- StandardContext.java      9 Aug 2003 19:54:47 -0000       1.81
  +++ StandardContext.java      10 Aug 2003 09:47:33 -0000      1.82
  @@ -3762,18 +3762,22 @@
               }
           }
           
  -        String logName="tomcat." + getParent().getName() + "." +
  -                ("".equals(getName()) ? "ROOT" : getName()) + ".Context";
  -        log=org.apache.commons.logging.LogFactory.getLog(logName);
  +        String logName = "tomcat." + getParent().getName() + "." +
  +            ("".equals(getName()) ? "ROOT" : getName()) + ".Context";
  +        log = org.apache.commons.logging.LogFactory.getLog(logName);
   
  -        //if (log.isDebugEnabled())
  -            log.debug("Starting " + logName);
  +        log.debug("Starting " + logName);
  +
  +        if ((oname != null) && 
  +            (Registry.getRegistry().getMBeanServer().isRegistered(oname))) {
  +            // As things depend on the JMX registration, the context
  +            // must be reregistered again once properly initialized
  +            Registry.getRegistry().unregisterComponent(oname);
  +        }
   
           // Notify our interested LifecycleListeners
           lifecycle.fireLifecycleEvent(BEFORE_START_EVENT, null);
   
  -        if (log.isDebugEnabled())
  -            log.debug("Processing start(), current available=" + getAvailable());
           setAvailable(false);
           setConfigured(false);
           boolean ok = true;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to