Re: cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Catalina.java CatalinaProperties.java ContextConfig.java Embedded.java

2005-09-29 Thread Bill Barker


- Original Message - 
From: [EMAIL PROTECTED]

To: [EMAIL PROTECTED]
Sent: Wednesday, September 28, 2005 10:52 PM
Subject: cvs commit: 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup 
Catalina.java CatalinaProperties.java ContextConfig.java Embedded.java




costin  2005/09/28 22:52:49

snip/

 + // That's fine - we have reasonable defaults.
 + properties=new Properties();
  }

  // Register the properties as system properties
 -Enumeration enumeration = properties.propertyNames();
 + Enumeration enumeration = properties.propertyNames();
  while (enumeration.hasMoreElements()) {
  String name = (String) enumeration.nextElement();
  String value = properties.getProperty(name);


The dreaded Tab-Police are actually pretty strict in the 5.5.x branch :-).



This message is intended only for the use of the person(s) listed above as the 
intended recipient(s), and may contain information that is PRIVILEGED and 
CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or 
distribute this message or any attachment. If you received this communication 
in error, please notify us immediately by e-mail and then delete all copies of 
this message and any attachments.

In addition you should be aware that ordinary (unencrypted) e-mail sent through 
the Internet is not secure. Do not send confidential or sensitive information, 
such as social security numbers, account numbers, personal identification 
numbers and passwords, to us via ordinary (unencrypted) e-mail.


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



cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Catalina.java CatalinaProperties.java ContextConfig.java Embedded.java

2005-09-28 Thread costin
costin  2005/09/28 22:52:49

  Modified:catalina/src/share/org/apache/catalina/startup Catalina.java
CatalinaProperties.java ContextConfig.java
Embedded.java
  Log:
  Another small commit dealing with the 'single-jar'/minimal case, where we 
don't have all the dir structure or fancy startup script.
  
  It defaults catalina.home to user.dir, reads default server.xml and web.xml 
out of resources, set the properties to avoid NPE.
  
  Let me know if there is a problem with this - easy to roll back, but 
shouldn't hurt any of the existing functionality.
  
  Revision  ChangesPath
  1.39  +16 -1 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- Catalina.java 31 Aug 2005 14:06:40 -  1.38
  +++ Catalina.java 29 Sep 2005 05:52:47 -  1.39
  @@ -463,6 +463,21 @@
   }
   }
   
  +// This should be included in catalina.jar
  +// Alternative: don't bother with xml, just create it manually.
  +if( inputStream==null ) {
  +try {
  +inputStream = getClass().getClassLoader()
  +.getResourceAsStream(server-embed.xml);
  +inputSource = new InputSource
  +(getClass().getClassLoader()
  +.getResource(server-embed.xml).toString());
  +} catch (Exception e) {
  +;
  +}
  +}
  +
  +
   if ((inputStream == null)  (file != null)) {
   log.warn(Can't load server.xml from  + file.getAbsolutePath());
   return;
  
  
  
  1.9   +5 -3  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaProperties.java
  
  Index: CatalinaProperties.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/CatalinaProperties.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- CatalinaProperties.java   16 Sep 2004 23:19:54 -  1.8
  +++ CatalinaProperties.java   29 Sep 2005 05:52:47 -  1.9
  @@ -57,7 +57,7 @@
* Return specified property value.
*/
   public static String getProperty(String name) {
  -
  + 
   return properties.getProperty(name);
   
   }
  @@ -126,10 +126,12 @@
   if ((is == null) || (error != null)) {
   // Do something
   log.warn(Failed to load catalina.properties, error);
  + // That's fine - we have reasonable defaults.
  + properties=new Properties();
   }
   
   // Register the properties as system properties
  -Enumeration enumeration = properties.propertyNames();
  + Enumeration enumeration = properties.propertyNames();
   while (enumeration.hasMoreElements()) {
   String name = (String) enumeration.nextElement();
   String value = properties.getProperty(name);
  
  
  
  1.66  +14 -2 
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java
  
  Index: ContextConfig.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- ContextConfig.java21 Jul 2005 21:40:56 -  1.65
  +++ ContextConfig.java29 Sep 2005 05:52:47 -  1.66
  @@ -589,7 +589,19 @@
   source = new InputSource
   (getClass().getClassLoader()
   .getResource(defaultWebXml).toString());
  -} else {
  +} 
  +if( stream== null ) { 
  +// maybe embedded
  +stream = getClass().getClassLoader()
  +.getResourceAsStream(web-embed.xml);
  +if( stream != null ) {
  +source = new InputSource
  +(getClass().getClassLoader()
  +.getResource(web-embed.xml).toString());
  +} 
  +}
  +
  +if( stream== null ) {
   log.info(No default web.xml);
   }
   } else {
  
  
  
  1.29  +6 -2  
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Embedded.java
  
  Index: