cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2004-03-16 Thread luehe
luehe   2004/03/16 11:25:39

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  Fix for Bugzilla 27664 (Welcome files not found in combination with
  jsp-property-group)
  
  Rather than having the JspServlet know about welcome files, the mapper
  algorithm has been amended to search for welcome files in URI spaces
  that match a url-pattern in a jsp-property-group.
  
  Please review carefully and let me know what you think.
  
  Revision  ChangesPath
  1.19  +4 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- MapperListener.java   27 Feb 2004 14:58:53 -  1.18
  +++ MapperListener.java   16 Mar 2004 19:25:39 -  1.19
  @@ -469,7 +469,10 @@
   mBeanServer.invoke(objectName, findMappingObject, null, null);
   
   for (int i = 0; i  mappings.length; i++) {
  -mapper.addWrapper(hostName, contextName, mappings[i], wrapper);
  +boolean jspWildCard = (wrapperName.equals(jsp)
  +mappings[i].endsWith(/*));
  +mapper.addWrapper(hostName, contextName, mappings[i], wrapper,
  +  jspWildCard);
   }
   
   }
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2004-02-17 Thread jfarcand
jfarcand2004/02/17 14:15:34

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  The defaultHostName may be alias, so we need to also try to find if the registered 
hosts' aliases contains the defaultHostName.
  
  Revision  ChangesPath
  1.17  +28 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- MapperListener.java   2 Feb 2004 17:35:47 -   1.16
  +++ MapperListener.java   17 Feb 2004 22:15:34 -  1.17
  @@ -293,7 +293,34 @@
   ObjectName hostName = new ObjectName
   (domain + :type=Host, + host= + defaultHost);
   if (!mBeanServer.isRegistered(hostName)) {
  -log.warn(Unknown default host:  + defaultHost);
  +
  +// Get the hosts' list
  +String onStr = domain + :type=Host,*;
  +ObjectName objectName = new ObjectName(onStr);
  +Set set = mBeanServer.queryMBeans(objectName, null);
  +Iterator iterator = set.iterator();
  +String[] aliases;
  +boolean isRegisteredWithAlias = false;
  +
  +while (iterator.hasNext()) {
  +
  +if (isRegisteredWithAlias) break;
  +
  +ObjectInstance oi = (ObjectInstance) iterator.next();
  +hostName = oi.getObjectName();
  +aliases = (String[])
  +mBeanServer.invoke(hostName, findAliases, null, null);
  +
  +for (int i=0; i  aliases.length; i++){
  +if (aliases[i].equalsIgnoreCase(defaultHost)){
  +isRegisteredWithAlias = true;
  +break;
  +}
  +}
  +}
  +
  +if (!isRegisteredWithAlias)
  +log.warn(Unknown default host:  + defaultHost);
   }
   // This should probablt be called later 
   if( defaultHost != null ) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2004-02-02 Thread remm
remm2004/02/02 09:35:47

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  - Bug 26567: The mapper will complain if the default host is not known, which
could make mapping fail without a way to easily identify the cause. Initialization
will not fail, this is simply a warning message.
  - (obviously, this class needs lang strings)
  
  Revision  ChangesPath
  1.16  +5 -0  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- MapperListener.java   26 Jan 2004 20:19:10 -  1.15
  +++ MapperListener.java   2 Feb 2004 17:35:47 -   1.16
  @@ -290,6 +290,11 @@
   if ( ! mBeanServer.isRegistered(engineName)) return;
   String defaultHost = 
   (String) mBeanServer.getAttribute(engineName, defaultHost);
  +ObjectName hostName = new ObjectName
  +(domain + :type=Host, + host= + defaultHost);
  +if (!mBeanServer.isRegistered(hostName)) {
  +log.warn(Unknown default host:  + defaultHost);
  +}
   // This should probablt be called later 
   if( defaultHost != null ) {
   mapper.setDefaultHostName(defaultHost);
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2004-01-01 Thread billbarker
billbarker2004/01/01 17:23:28

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  Fix error-condition logging statements (printStackTrace is just evil :).
  
  Revision  ChangesPath
  1.14  +2 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MapperListener.java   23 Dec 2003 11:09:31 -  1.13
  +++ MapperListener.java   2 Jan 2004 01:23:28 -   1.14
  @@ -235,7 +235,7 @@
   try {
   registerHost(objectName);
   } catch (Exception e) {
  -e.printStackTrace();  
  +log.warn(Error registering Host  + objectName, e);  
   }
   }
   
  @@ -261,7 +261,7 @@
   try {
   unregisterHost(objectName);
   } catch (Exception e) {
  -e.printStackTrace();  
  +log.warn(Error unregistering Host  + objectName,e);  
   }
   }

  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-12-23 Thread remm
remm2003/12/23 03:09:31

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  - Fix host removal from the mapper (the corresponding MBean
likely was unregistered previously).
  
  Revision  ChangesPath
  1.13  +2 -4  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- MapperListener.java   22 Dec 2003 17:49:12 -  1.12
  +++ MapperListener.java   23 Dec 2003 11:09:31 -  1.13
  @@ -311,14 +311,12 @@
   
   
   /**
  - * Unregister host (FIXME.
  + * Unregister host.
*/
   private void unregisterHost(ObjectName objectName)
   throws Exception {
   String name=objectName.getKeyProperty(host);
  -String[] aliases = (String[])
  -mBeanServer.invoke(objectName, findAliases, null, null);
  -mapper.removeHost(name, aliases);
  +mapper.removeHost(name);
   }
   
   
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-12-22 Thread remm
remm2003/12/22 09:49:12

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  - Oops, a try/catch when adding a wrapper, similar to what is done when
handling contexts.
  
  Revision  ChangesPath
  1.12  +5 -1  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- MapperListener.java   11 Aug 2003 13:18:03 -  1.11
  +++ MapperListener.java   22 Dec 2003 17:49:12 -  1.12
  @@ -440,7 +440,11 @@
   // name attribute is the same... - then it's ours
   String targetDomain=objectName.getDomain();
   if( ! domain.equals( targetDomain )) {
  -targetDomain=(String) mBeanServer.getAttribute(objectName, 
engineName);
  +try {
  +targetDomain=(String) mBeanServer.getAttribute(objectName, 
engineName);
  +} catch (Exception e) {
  +// Ignore
  +}
   if( ! domain.equals( targetDomain )) {
   // not ours
   return;
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-08-12 Thread remm
remm2003/08/11 06:18:03

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  - Remove some stack trace dumping. This class would need more
similar cleanups.
  
  Revision  ChangesPath
  1.11  +23 -3 
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MapperListener.java   23 Jul 2003 17:44:37 -  1.10
  +++ MapperListener.java   11 Aug 2003 13:18:03 -  1.11
  @@ -213,7 +213,7 @@
   engineName = (String)
   mBeanServer.getAttribute(objectName, engineName);
   } catch (Exception e) {
  -e.printStackTrace();  
  +// Ignore  
   }
   }
   }
  @@ -334,12 +334,16 @@
   // name attribute is the same... - then it's ours
   String targetDomain=objectName.getDomain();
   if( ! domain.equals( targetDomain )) {
  -targetDomain=(String) mBeanServer.getAttribute(objectName, 
engineName);
  +try {
  +targetDomain = (String) mBeanServer.getAttribute
  +(objectName, engineName);
  +} catch (Exception e) {
  +// Ignore
  +}
   if( ! domain.equals( targetDomain )) {
   // not ours
   return;
   }
  -
   }
   
   String hostName = null;
  @@ -384,6 +388,22 @@
   throws Exception {
   
   String name = objectName.getKeyProperty(name);
  +
  +// If the domain is the same with ours or the engine 
  +// name attribute is the same... - then it's ours
  +String targetDomain=objectName.getDomain();
  +if( ! domain.equals( targetDomain )) {
  +try {
  +targetDomain = (String) mBeanServer.getAttribute
  +(objectName, engineName);
  +} catch (Exception e) {
  +// Ignore
  +}
  +if( ! domain.equals( targetDomain )) {
  +// not ours
  +return;
  +}
  +}
   
   String hostName = null;
   String contextName = null;
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-07-23 Thread jfarcand
jfarcand2003/07/23 10:44:37

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  Better solution for the undeployment problem. the engineName is always null when 
undeploying an application.
  
  Revision  ChangesPath
  1.10  +8 -0  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MapperListener.java   23 Jul 2003 04:02:29 -  1.9
  +++ MapperListener.java   23 Jul 2003 17:44:37 -  1.10
  @@ -219,6 +219,14 @@
   }
   }
   
  +// At deployment time, engineName is always = null.
  +if ( (!*.equals(domain)) 
  + ( !domain.equals(objectName.getDomain()) ) 
  + ( (!domain.equals(engineName) ) 
  +   (engineName != null) ) )  {
  +return;
  +}
  +
   log.debug( Handle  + objectName );
   if (notification.getType().equals
   (MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-07-22 Thread jfarcand
jfarcand2003/07/22 21:02:29

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  When using the embedded interface (or jmx directly), context are never removed 
because of this condition (mapper.removeContext is never called).
  
  Then if you re-deploy the same app, The Mapper will maps the http call to the first 
Mapper's context object, which is an invalid (orphan) object. The client always 
receives a 503 (since the context is invalid and marked as unavailable).
  
  Removing the condition doesn't have any side effect (but fix the problem).
  
  Revision  ChangesPath
  1.9   +1 -8  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- MapperListener.java   14 Jul 2003 02:54:52 -  1.8
  +++ MapperListener.java   23 Jul 2003 04:02:29 -  1.9
  @@ -218,14 +218,7 @@
   }
   }
   }
  -if ( ! *.equals( domain ) 
  -! domain.equals( objectName.getDomain() ) 
  -! domain.equals( engineName ) ) {
  -// A different domain - not ours
  -if( j2eeType!=null )
  -log.debug(MBean in different domain  + objectName);
  -return;
  -}
  +
   log.debug( Handle  + objectName );
   if (notification.getType().equals
   (MBeanServerNotification.REGISTRATION_NOTIFICATION)) {
  
  
  

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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5 MapperListener.java

2003-07-13 Thread remm
remm2003/07/13 19:54:52

  Modified:catalina/src/share/org/apache/coyote/tomcat5
MapperListener.java
  Log:
  - Add support for mapping host aliases. I apparently forgot that, oops (bug 21553).
  - All host aliases will share the same context array instance.
  
  Revision  ChangesPath
  1.8   +8 -6  
jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java
  
  Index: MapperListener.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/MapperListener.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MapperListener.java   2 May 2003 20:12:15 -   1.7
  +++ MapperListener.java   14 Jul 2003 02:54:52 -  1.8
  @@ -296,15 +296,15 @@
   }
   
   /**
  - * Register host (FIXME).
  + * Register host.
*/
   private void registerHost(ObjectName objectName)
  -throws Exception
  -{
  +throws Exception {
   String name=objectName.getKeyProperty(host);
  -log.debug(Register host  + name);
   if( name != null ) {
  -mapper.addHost(name, objectName);
  +String[] aliases = (String[])
  +mBeanServer.invoke(objectName, findAliases, null, null);
  +mapper.addHost(name, aliases, objectName);
   }
   }
   
  @@ -315,7 +315,9 @@
   private void unregisterHost(ObjectName objectName)
   throws Exception {
   String name=objectName.getKeyProperty(host);
  -mapper.removeHost(name);
  +String[] aliases = (String[])
  +mBeanServer.invoke(objectName, findAliases, null, null);
  +mapper.removeHost(name, aliases);
   }
   
   
  
  
  

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