cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2004-10-02 Thread billbarker
billbarker2004/10/02 13:29:21

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Set the ContextCL before loading loading EmbededTomcat.
  
  EmbededTomcat will reset it, but this seems to make log4j configuration easier.
  
  Revision  ChangesPath
  1.46  +2 -1  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Main.java 25 Feb 2004 07:25:48 -  1.45
  +++ Main.java 2 Oct 2004 20:29:21 -   1.46
  @@ -256,6 +256,7 @@
initSecurityFile();
initClassLoader();
   
  + jdk11Compat.setContextClassLoader(commonCL);
   Class cls=commonCL.loadClass((String)tasks.get(task));

   Object proxy=cls.newInstance();
  
  
  

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



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2002-01-24 Thread larryi

larryi  02/01/24 03:16:03

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Provide some additional error output
  
  Revision  ChangesPath
  1.42  +7 -1  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- Main.java 9 Sep 2001 00:46:28 -   1.41
  +++ Main.java 24 Jan 2002 11:16:03 -  1.42
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.41 2001/09/09 00:46:28 costin Exp $
  +/* $Id: Main.java,v 1.42 2002/01/24 11:16:03 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -313,7 +313,13 @@
   IntrospectionUtils.execute(  proxy, execute );
   } catch( Exception ex ) {
   System.out.println(Guessed home= + installDir);
  +System.out.println(Exception:  + ex);
   ex.printStackTrace();
  +if( ex instanceof InvocationTargetException ) {
  +Throwable t = ((InvocationTargetException)ex).getTargetException();
  +System.out.println(Root Exception:  + t );
  +t.printStackTrace();
  +}
   }
   }
   
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-08-20 Thread costin

costin  01/08/20 22:35:05

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  As expected, Main.java is now smaller. The first argument to Main is used
  to load a bean. It'll only set the common class loader, pass args[] and
  class loader informations, and call execute() method on the bean
  ( ant style ).
  
  Note that the bean itself will process the args. Right now we use magic
  to turn args into setXXX() calls ( like we do for server.xml, or like ant
  does with it's tasks ). Single option arguments are equivalent with
  boolean setters.
  
  Revision  ChangesPath
  1.37  +188 -228  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- Main.java 2001/07/16 01:09:07 1.36
  +++ Main.java 2001/08/21 05:35:05 1.37
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.36 2001/07/16 01:09:07 costin Exp $
  +/* $Id: Main.java,v 1.37 2001/08/21 05:35:05 costin Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -70,278 +70,238 @@
   import org.apache.tomcat.util.compat.Jdk11Compat;
   
   // The main idea is to have a starter with minimal class loader deps,
  -// and use it to create the initial environment
  +// and use it to create the initial environment. This class is pretty generic,
  +// deps on tomcat are minimal ( depends only on tomcat.util ).
   
   /**
  - Starter class for Tomcat.
  - p
  - This is a replacement/enhancement for the .sh and .bat files - you can
  - use JDK1.2 java -jar tomcat.jar, or ( for jdk 1.1 ) you just need to
  - include a single jar file in the classpath.
  - p
  - This class creates three class loader instances: 
  - ol
  - lia 'common' loader to be the parent of both the server
  - container and also webapp loaders./li
  - lian 'applications' loader to load classes used by all webapps, but
  - not the servlet engine./i
  - lia 'container' loader exclusively for the tomcat servlet engine./li
  - /ol
  - Both the 'apps' loader and 'container' loader have the common loader as
  - the parent class loader.  The class path for each is assembled like so:
  - ul
  - licommon - all elements of the 
  -   codeorg.apache.tomcat.common.classpath/code
  -   property plus all *.jar files found in ${TOMCAT_HOME}/lib/common/.
  -   /li
  - liapps - all elements of the 
  -   codeorg.apache.tomcat.apps.classpath/code
  -   property plus all *.jar files found in ${TOMCAT_HOME}/lib/apps/.
  -   In addition, all classes loaded via the 'common' loader./i
  - licontainer - all jar files found in ${TOMCAT_HOME}/lib/container/ plus 
  -   the class folder ${TOMCAT_HOME}/classes and finally also the utility 
  -   jar file ${JAVA_HOME}/lib/tools.jar.  In addition, all classes loaded
  -   via the common loader./li
  - /ul
  - After creating the above class loaders, this class instantiates, initializes
  - and starts an instance of the class 
codeorg.apache.tomcat.startup.Tomcat/code.
  - p
  - @author Costin Manolache
  - @author Ignacio J. Ortega
  - @author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.36 $ $Date: 2001/07/16 01:09:07 $
  + * Launcher capable of setting class loader and guessing locations.
  + * p
  + * This is a replacement/enhancement for the .sh and .bat files - you can
  + * use JDK1.2 java -jar [PROGRAM].jar, or ( for jdk 1.1 ) you just need to
  + * include a single jar file in the classpath.
  + * p
  + * The class will first guess it's own location by looking in each classpath
  + * location. It'll then process the command line parameters and based on
  + * a properties file, locate the actual class that will be started.
  + * p
  + * It'll then construct a class loader ( common ) from the content of a
  + * specified directory and/or additionl system property. Based on the first
  + * argument, it'll instantiate a class ( in the created class loader ), set the
  + * parameters, and call it's execute() method.
  + *
  + * @author Costin Manolache
  + * @author Ignacio J. Ortega
  + * @author Mel Martinez [EMAIL PROTECTED]
*/
   public class Main{
  +public static final String PROPERTY_COMMON_LOADER =
  + org.apache.tomcat.common.loader;
   
  -/**
  -name of configuration property to set (using the -D option at
  -startup or via .properties file) to specify the classpath
  -to be used by the ClassLoader shared amongst all web applications
  -(but not by the servlet container).  Specify this string as
  -normal file 

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-07-15 Thread costin

costin  01/07/15 18:09:08

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Make sure the context class loader is set ( if 1.2 available )
  
  Revision  ChangesPath
  1.36  +3 -2  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- Main.java 2001/06/13 21:28:28 1.35
  +++ Main.java 2001/07/16 01:09:07 1.36
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.35 2001/06/13 21:28:28 mmanders Exp $
  +/* $Id: Main.java,v 1.36 2001/07/16 01:09:07 costin Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -109,7 +109,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.35 $ $Date: 2001/06/13 21:28:28 $
  + @version $Revision: 1.36 $ $Date: 2001/07/16 01:09:07 $
*/
   public class Main{
   
  @@ -274,6 +274,7 @@
   ClassLoader serverCl=
   jdk11Compat.newClassLoaderInstance(serverClassPath ,
   commonCl);
  + jdk11Compat.setContextClassLoader( serverCl );
   
// Create the webapps class loader 
   Vector appsJars = new Vector();
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-06-13 Thread mmanders

mmanders01/06/13 14:28:32

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Updated addToTomcatClasspathSysProp to be able to run under 1.1.x
  
  Revision  ChangesPath
  1.35  +3 -3  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- Main.java 2001/06/11 11:36:06 1.34
  +++ Main.java 2001/06/13 21:28:28 1.35
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.34 2001/06/11 11:36:06 larryi Exp $
  +/* $Id: Main.java,v 1.35 2001/06/13 21:28:28 mmanders Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -109,7 +109,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.34 $ $Date: 2001/06/11 11:36:06 $
  + @version $Revision: 1.35 $ $Date: 2001/06/13 21:28:28 $
*/
   public class Main{
   
  @@ -338,7 +338,7 @@
   cp = url.getFile();
   }
   if( cp != null)
  -System.setProperty(tc_path_add,cp);
  +System.getProperties().put(tc_path_add,cp);
   }
   
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-06-11 Thread larryi

larryi  01/06/11 04:36:09

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Add handling to set the tc_path_add system property to include web
  application classpath entries.  This is used by Jasper's JspServlet.
  
  Revision  ChangesPath
  1.34  +29 -4 jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- Main.java 2001/06/09 03:35:06 1.33
  +++ Main.java 2001/06/11 11:36:06 1.34
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.33 2001/06/09 03:35:06 costin Exp $
  +/* $Id: Main.java,v 1.34 2001/06/11 11:36:06 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -109,7 +109,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.33 $ $Date: 2001/06/09 03:35:06 $
  + @version $Revision: 1.34 $ $Date: 2001/06/11 11:36:06 $
*/
   public class Main{
   
  @@ -254,6 +254,7 @@
   getCommonDir());
IntrospectionUtils.addJarsFromClassPath(commonJars,
TOMCAT_COMMON_CLASSPATH);
  +addToTomcatClasspathSysProp(commonJars);
   
   URL[] commonClassPath=IntrospectionUtils.getClassPath(commonJars);
//displayClassPath( common , commonClassPath );
  @@ -279,8 +280,8 @@
IntrospectionUtils.addToClassPath(appsJars, getAppsDir());
IntrospectionUtils.addJarsFromClassPath( appsJars, 
 TOMCAT_APPS_CLASSPATH);
  +addToTomcatClasspathSysProp(appsJars);
   
  - 
   URL[] appsClassPath=IntrospectionUtils.getClassPath(appsJars);
   ClassLoader appsCl=
jdk11Compat.newClassLoaderInstance(appsClassPath ,
  @@ -314,7 +315,31 @@
System.out.println( cp[i].getFile() );
}
   }
  -
  +
  +/**
  + * Adds classpath entries from a vector of URL's to the
  + * tc_path_add System property.  This System property lists
  + * the classpath entries common to web applications. This System
  + * property is currently used by Jasper when its JSP servlet
  + * compiles the Java file for a JSP.
  +*/
  +
  +private void addToTomcatClasspathSysProp(Vector v)
  +{
  +String sep = System.getProperty(path.separator);
  +String cp = System.getProperty(tc_path_add);
  +
  +Enumeration e = v.elements();
  +while( e.hasMoreElements() ) {
  +URL url = (URL)e.nextElement();
  +if( cp != null)
  +cp += sep + url.getFile();
  +else
  +cp = url.getFile();
  +}
  +if( cp != null)
  +System.setProperty(tc_path_add,cp);
  +}
   
   }
   
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-06-08 Thread costin

costin  01/06/08 20:35:07

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  The cleanup of Main - the duplicated methods are moved in util, unused
  code removed, the other class loaders are saved ( instead of just abandoning
  them and using getClassLoader later )
  
  Revision  ChangesPath
  1.33  +69 -205   jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Main.java 2001/05/21 04:44:24 1.32
  +++ Main.java 2001/06/09 03:35:06 1.33
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.32 2001/05/21 04:44:24 costin Exp $
  +/* $Id: Main.java,v 1.33 2001/06/09 03:35:06 costin Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -69,6 +69,8 @@
   import org.apache.tomcat.util.IntrospectionUtils;
   import org.apache.tomcat.util.compat.Jdk11Compat;
   
  +// The main idea is to have a starter with minimal class loader deps,
  +// and use it to create the initial environment
   
   /**
Starter class for Tomcat.
  @@ -107,7 +109,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.32 $ $Date: 2001/05/21 04:44:24 $
  + @version $Revision: 1.33 $ $Date: 2001/06/09 03:35:06 $
*/
   public class Main{
   
  @@ -199,74 +201,35 @@
   
   //  Utils 
   
  -public static String checkDir( String base ) {
  -String r=null;
  -try {
  -File f = new File(base);
  -r = f.getCanonicalPath();
  -if( ! r.endsWith(/)  ! r.endsWith(File.separator) ) 
r+=File.separator;
  -} catch (IOException ioe) {
  -ioe.printStackTrace();
  -r=base;
  -}
  -return r;
  +public String getInstallDir() {
  + if( installDir==null )
  + installDir=.;
  + return installDir;
   }
   
  -public static URL getURL( String base, String file ) {
  -try {
  -File baseF = new File(base);
  -File f = new File(baseF,file);
  -String path = f.getCanonicalPath();
  -if( f.isDirectory() ){
  -path +=/;
  -}
  -return new URL( file, , path );
  -} catch (Exception ex) {
  -ex.printStackTrace();
  -return null;
  -}
  -}
  -
   public String getServerDir() {
  -if( libBase!=null ){
  -return libBase;
  +if( libBase==null ){
  + libBase=getInstallDir() + File.separator + lib +
  + File.separator + container + File.separator;
   }
  -if( installDir!=null ){
  -libBase=checkDir( installDir + File.separator + lib +
  -   File.separator + container);
  -}else{
  -libBase=checkDir(. + File.separator + lib +
  -  File.separator + container);
  -}
  -return libBase;
  + return libBase;
   }
   
   public String getAppsDir() {
  -if( serverBase!=null ){
  -return serverBase;
  -}
  -if( installDir!=null ){
  -serverBase=checkDir( installDir + File.separator + lib +
  -  File.separator + apps);
  -}else{
  -serverBase=checkDir(. + File.separator + lib +
  - File.separator + apps);
  +if( serverBase==null ){
  + serverBase=getInstallDir() + File.separator + lib +
  + File.separator + apps + File.separator;
   }
  -return serverBase;
  + return serverBase;
   }
   
   public String getCommonDir() {
  -if( commonBase!=null ){
  -return commonBase;
  +if( commonBase==null ){
  + commonBase=getInstallDir() + File.separator + lib +
  + File.separator+ common + File.separator;
  + 
   }
  -if( installDir!=null ){
  -commonBase=checkDir( installDir + File.separator + lib +
  -  File.separator+ common);
  -}else{
  -commonBase=checkDir(. +File.separator + lib +
  - File.separator + common);
  -}
  -return commonBase;
  + return commonBase;
   }
   
   
  @@ -281,47 +244,49 @@
   homeDir = System.getProperty(tomcat.home);
   
   ClassLoader parentL=this.getClass().getClassLoader();
  +
  +// the server classloader loads from classes dir too and
  + // from tools.jar
   
  -// the 

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-05-20 Thread costin

costin  01/05/20 21:44:25

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Use File.separator. It's an old bug, don't remember the number.
  ( has been on my computer for a while )
  
  Revision  ChangesPath
  1.32  +16 -10jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- Main.java 2001/03/25 21:53:15 1.31
  +++ Main.java 2001/05/21 04:44:24 1.32
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.31 2001/03/25 21:53:15 larryi Exp $
  +/* $Id: Main.java,v 1.32 2001/05/21 04:44:24 costin Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -107,7 +107,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.31 $ $Date: 2001/03/25 21:53:15 $
  + @version $Revision: 1.32 $ $Date: 2001/05/21 04:44:24 $
*/
   public class Main{
   
  @@ -174,7 +174,7 @@
   String serverBase;
   String commonBase;
   String homeDir;
  -static final String DEFAULT_CONFIG=conf/server.xml;
  +static final String DEFAULT_CONFIG=conf + File.separator + server.xml;
   boolean doStop=false;
   // if needed
   // null means user didn't set one
  @@ -204,7 +204,7 @@
   try {
   File f = new File(base);
   r = f.getCanonicalPath();
  -if( ! r.endsWith(/) ) r+=/;
  +if( ! r.endsWith(/)  ! r.endsWith(File.separator) ) 
r+=File.separator;
   } catch (IOException ioe) {
   ioe.printStackTrace();
   r=base;
  @@ -232,9 +232,11 @@
   return libBase;
   }
   if( installDir!=null ){
  -libBase=checkDir( installDir + /lib/container);
  +libBase=checkDir( installDir + File.separator + lib +
  +   File.separator + container);
   }else{
  -libBase=checkDir(./lib/container);
  +libBase=checkDir(. + File.separator + lib +
  +  File.separator + container);
   }
   return libBase;
   }
  @@ -244,9 +246,11 @@
   return serverBase;
   }
   if( installDir!=null ){
  -serverBase=checkDir( installDir + /lib/apps);
  +serverBase=checkDir( installDir + File.separator + lib +
  +  File.separator + apps);
   }else{
  -serverBase=checkDir(./lib/apps);
  +serverBase=checkDir(. + File.separator + lib +
  + File.separator + apps);
   }
   return serverBase;
   }
  @@ -256,9 +260,11 @@
   return commonBase;
   }
   if( installDir!=null ){
  -commonBase=checkDir( installDir + /lib/common);
  +commonBase=checkDir( installDir + File.separator + lib +
  +  File.separator+ common);
   }else{
  -commonBase=checkDir(./lib/common);
  +commonBase=checkDir(. +File.separator + lib +
  + File.separator + common);
   }
   return commonBase;
   }
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-05 Thread larryi

larryi  01/03/05 09:38:47

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Remove use of "tomcat.cp" system property which has been replaced
  by "org.apache.tomcat.apps.classpath" and
  "org.apache.tomcat.common.classpath" system properties.
  
  Submitted by: William Barker
  
  Revision  ChangesPath
  1.29  +2 -15 jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Main.java 2001/03/04 22:38:14 1.28
  +++ Main.java 2001/03/05 17:38:44 1.29
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.28 2001/03/04 22:38:14 melaquias Exp $
  +/* $Id: Main.java,v 1.29 2001/03/05 17:38:44 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -107,7 +107,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.28 $ $Date: 2001/03/04 22:38:14 $
  + @version $Revision: 1.29 $ $Date: 2001/03/05 17:38:44 $
*/
   public class Main{
   
  @@ -428,19 +428,6 @@
   urlV.addElement( getURL(  p0 , cpComp[i] ));
   }
   }
  - // add CLASSPATH
  - String cpath=System.getProperty( "tomcat.cp");
  - if( cpath!=null ) {
  - System.out.println("Extra CLASSPATH: " + cpath);
  - String pathSep=System.getProperty( "path.separator");
  - StringTokenizer st=new StringTokenizer( cpath, pathSep );
  - while( st.hasMoreTokens() ) {
  - String path=st.nextToken();
  - urlV.addElement( getURL( path, "" ));
  - }
  - }
  -
  -
   }catch(Exception ex){
   ex.printStackTrace();
   }
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-05 Thread larryi

larryi  01/03/05 21:25:16

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Vector.contains() for vectors of URLs makes use of URL.equals().  Under
  Jdk1.1, URL.equals() throws NPE's if host = null.  Host = "" seems to work
  better.
  
  Revision  ChangesPath
  1.30  +5 -5  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- Main.java 2001/03/05 17:38:44 1.29
  +++ Main.java 2001/03/06 05:25:14 1.30
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.29 2001/03/05 17:38:44 larryi Exp $
  +/* $Id: Main.java,v 1.30 2001/03/06 05:25:14 larryi Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -107,7 +107,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.29 $ $Date: 2001/03/05 17:38:44 $
  + @version $Revision: 1.30 $ $Date: 2001/03/06 05:25:14 $
*/
   public class Main{
   
  @@ -220,7 +220,7 @@
   if( f.isDirectory() ){
   path +="/";
   }
  -return new URL( "file", null, path );
  +return new URL( "file", "", path );
   } catch (Exception ex) {
   ex.printStackTrace();
   return null;
  @@ -281,7 +281,7 @@
   for(int i=0; i  serverUrlV.size();i++){
   serverJars.addElement(serverUrlV.elementAt(i));
   }
  -serverJars.addElement( new URL( "file", null ,
  +serverJars.addElement( new URL( "file", "" ,
   System.getProperty( "java.home" ) + "/../lib/tools.jar"));
   
   Vector commonDirJars = getClassPathV(getCommonDir());
  @@ -392,7 +392,7 @@
   if(f.isDirectory()){
   path += "/";
   }
  -URL url = new URL("file",null,path);
  +URL url = new URL("file","",path);
   if(!jars.contains(url)){
   jars.addElement(url);
   }
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-04 Thread melaquias

melaquias01/03/04 14:38:16

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Changed name of configuration property "org.apache.tomcat.shared.classpath" to 
"org.apache.tomcat.apps.classpath" to be consistent with the new TOMCAT_HOME/lib/ 
directory structure.
  Updated javadoc comments to match.
  
  Revision  ChangesPath
  1.28  +36 -31jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Main.java 2001/03/04 03:36:52 1.27
  +++ Main.java 2001/03/04 22:38:14 1.28
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.27 2001/03/04 03:36:52 costin Exp $
  +/* $Id: Main.java,v 1.28 2001/03/04 22:38:14 melaquias Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -81,30 +81,35 @@
ol
lia 'common' loader to be the parent of both the server
container and also webapp loaders./li
  - lia 'shared' loader to load classes used by all webapps, but
  + lian 'applications' loader to load classes used by all webapps, but
not the servlet engine./i
  - lia 'server' loader exclusively for the tomcat servlet engine./li
  + lia 'container' loader exclusively for the tomcat servlet engine./li
/ol
  - Both the 'shared' loader and 'server' loader have the common loader as
  + Both the 'apps' loader and 'container' loader have the common loader as
the parent class loader.  The class path for each is assembled like so:
ul
  - licommon - all elements of the 
codeorg.apache.tomcat.common.classpath/code
  -   property plus all *.jar files found in ${TOMCAT_HOME}/lib/common/./li
  - lishared - all elements of the 
codeorg.apache.tomcat.shared.classpath/code
  -   property plus all *.jar files found in ${TOMCAT_HOME}/lib/shared/./i
  - liserver - all jar files found in ${TOMCAT_HOME}/lib, plus the class
  -   folder ${TOMCAT_HOME}/classes and finally also the utility jar
  -   file ${JAVA_HOME}/lib/tools.jar./li
  - /ol
  + licommon - all elements of the 
  +   codeorg.apache.tomcat.common.classpath/code
  +   property plus all *.jar files found in ${TOMCAT_HOME}/lib/common/.
  +   /li
  + liapps - all elements of the 
  +   codeorg.apache.tomcat.apps.classpath/code
  +   property plus all *.jar files found in ${TOMCAT_HOME}/lib/apps/.
  +   In addition, all classes loaded via the 'common' loader./i
  + licontainer - all jar files found in ${TOMCAT_HOME}/lib/container/ plus 
  +   the class folder ${TOMCAT_HOME}/classes and finally also the utility 
  +   jar file ${JAVA_HOME}/lib/tools.jar.  In addition, all classes loaded
  +   via the common loader./li
  + /ul
After creating the above class loaders, this class instantiates, initializes
and starts an instance of the class 
codeorg.apache.tomcat.startup.Tomcat/code.
p
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.27 $ $Date: 2001/03/04 03:36:52 $
  + @version $Revision: 1.28 $ $Date: 2001/03/04 22:38:14 $
*/
  -public class Main {
  +public class Main{
   
   /**
   name of configuration property to set (using the -D option at
  @@ -114,18 +119,18 @@
   normal file paths separated by the path.seperator delimiter for
   the host platform.  Example (unix):
   precode
  -* org.apache.tomcat.shared.classpath = /home/mypath/lib/mylib.jar: \
  +* org.apache.tomcat.apps.classpath = /home/mypath/lib/mylib.jar: \
   *  /home/mypath/classes/
   /code/pre
   */
  -public static final String TOMCAT_SHARED_CLASSPATH_PROPERTY =
  -"org.apache.tomcat.shared.classpath";
  +public static final String TOMCAT_APPS_CLASSPATH_PROPERTY =
  +"org.apache.tomcat.apps.classpath";
   
   /**
   the classpath shared among all web apps (in addition to any
  -jar files placed directly in $TOMCAT_HOME/lib/shared/).
  +jar files placed directly in $TOMCAT_HOME/lib/apps/).
   */
  -public static final String TOMCAT_SHARED_CLASSPATH;
  +public static final String TOMCAT_APPS_CLASSPATH;
   
   /**
   name of configuration property to set (using the -D option at
  @@ -151,11 +156,11 @@
   
   static{
   String s=null;
  -s = System.getProperty(TOMCAT_SHARED_CLASSPATH_PROPERTY);
  +s = 

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-03-03 Thread costin

costin  01/03/03 19:36:52

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  The new lib structure - change the Main for that.
  
  Also: classes/ are no longer included ( the build is generating the right
  jars, having the expanded classes may affect the testing in build
  versus dist )
  
  Revision  ChangesPath
  1.27  +7 -7  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Main.java 2001/02/26 09:42:30 1.26
  +++ Main.java 2001/03/04 03:36:52 1.27
  @@ -1,4 +1,4 @@
  -/* $Id: Main.java,v 1.26 2001/02/26 09:42:30 nacho Exp $
  +/* $Id: Main.java,v 1.27 2001/03/04 03:36:52 costin Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -102,7 +102,7 @@
@author Costin Manolache
@author Ignacio J. Ortega
@author Mel Martinez [EMAIL PROTECTED]
  - @version $Revision: 1.26 $ $Date: 2001/02/26 09:42:30 $
  + @version $Revision: 1.27 $ $Date: 2001/03/04 03:36:52 $
*/
   public class Main {
   
  @@ -227,9 +227,9 @@
   return libBase;
   }
   if( homeDir!=null ){
  -libBase=checkDir( homeDir + "/lib");
  +libBase=checkDir( homeDir + "/lib/container");
   }else{
  -libBase=checkDir("./lib");
  +libBase=checkDir("./lib/container");
   }
   return libBase;
   }
  @@ -239,9 +239,9 @@
   return serverBase;
   }
   if( homeDir!=null ){
  -serverBase=checkDir( homeDir + "/lib/shared");
  +serverBase=checkDir( homeDir + "/lib/apps");
   }else{
  -serverBase=checkDir("./lib/shared");
  +serverBase=checkDir("./lib/apps");
   }
   return serverBase;
   }
  @@ -271,7 +271,7 @@
   // the server classloader loads from classes dir too and from tools.jar
   
   Vector serverJars=new Vector();
  -serverJars.addElement( getURL(  getServerDir() ,"../classes/" ));
  +//serverJars.addElement( getURL(  getServerDir() ,"../classes/" ));
   Vector serverUrlV =getClassPathV(getServerDir());
   for(int i=0; i  serverUrlV.size();i++){
   serverJars.addElement(serverUrlV.elementAt(i));
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-02-26 Thread nacho

nacho   01/02/26 01:42:30

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Added :
  
  org.apache.tomcat.common.classpath
  org.apache.tomcat.shared.classpath
  
  System properties to set the shared and common classpath, this are added prior
  to adding the internal lib directories ..
  
  Submitted by Mel Martinez [[EMAIL PROTECTED]]
  
  Revision  ChangesPath
  1.26  +222 -85   jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Main.java 2001/02/10 19:17:28 1.25
  +++ Main.java 2001/02/26 09:42:30 1.26
  @@ -1,4 +1,4 @@
  -/*
  +/* $Id: Main.java,v 1.26 2001/02/26 09:42:30 nacho Exp $
* 
*
* The Apache Software License, Version 1.1
  @@ -69,22 +69,101 @@
   import org.apache.tomcat.util.IntrospectionUtils;
   import org.apache.tomcat.util.compat.Jdk11Compat;
   
  -// Depends:
  -// JDK1.1
  -// tomcat.util.IntrospectionUtils, util.compat
   
   /**
  - * Starter for Tomcat.
  - *
  - * This is a replacement/enhancement for the .sh and .bat files - you can
  - * use JDK1.2 "java -jar tomcat.jar", or ( for jdk 1.1 ) you just need to
  - * include a single jar file in the classpath.
  - *
  - * @author Costin Manolache
  - * @author Ignacio J. Ortega
  - *
  + Starter class for Tomcat.
  + p
  + This is a replacement/enhancement for the .sh and .bat files - you can
  + use JDK1.2 "java -jar tomcat.jar", or ( for jdk 1.1 ) you just need to
  + include a single jar file in the classpath.
  + p
  + This class creates three class loader instances: 
  + ol
  + lia 'common' loader to be the parent of both the server
  + container and also webapp loaders./li
  + lia 'shared' loader to load classes used by all webapps, but
  + not the servlet engine./i
  + lia 'server' loader exclusively for the tomcat servlet engine./li
  + /ol
  + Both the 'shared' loader and 'server' loader have the common loader as
  + the parent class loader.  The class path for each is assembled like so:
  + ul
  + licommon - all elements of the 
codeorg.apache.tomcat.common.classpath/code
  +   property plus all *.jar files found in ${TOMCAT_HOME}/lib/common/./li
  + lishared - all elements of the 
codeorg.apache.tomcat.shared.classpath/code
  +   property plus all *.jar files found in ${TOMCAT_HOME}/lib/shared/./i
  + liserver - all jar files found in ${TOMCAT_HOME}/lib, plus the class
  +   folder ${TOMCAT_HOME}/classes and finally also the utility jar
  +   file ${JAVA_HOME}/lib/tools.jar./li
  + /ol
  + After creating the above class loaders, this class instantiates, initializes
  + and starts an instance of the class 
codeorg.apache.tomcat.startup.Tomcat/code.
  + p
  + @author Costin Manolache
  + @author Ignacio J. Ortega
  + @author Mel Martinez [EMAIL PROTECTED]
  + @version $Revision: 1.26 $ $Date: 2001/02/26 09:42:30 $
*/
   public class Main {
  +
  +/**
  +name of configuration property to set (using the -D option at
  +startup or via .properties file) to specify the classpath
  +to be used by the ClassLoader shared amongst all web applications
  +(but not by the servlet container).  Specify this string as
  +normal file paths separated by the path.seperator delimiter for
  +the host platform.  Example (unix):
  +precode
  +* org.apache.tomcat.shared.classpath = /home/mypath/lib/mylib.jar: \
  +*  /home/mypath/classes/
  +/code/pre
  +*/
  +public static final String TOMCAT_SHARED_CLASSPATH_PROPERTY =
  +"org.apache.tomcat.shared.classpath";
  +
  +/**
  +the classpath shared among all web apps (in addition to any
  +jar files placed directly in $TOMCAT_HOME/lib/shared/).
  +*/
  +public static final String TOMCAT_SHARED_CLASSPATH;
  +
  +/**
  +name of configuration property to set (using the -D option at
  +startup or via .properties file) to specify the classpath
  +to be used by the ClassLoader common to both the servlet engine
  +and all web applications.  Specify this string as
  +normal file paths separated by the path.seperator delimiter for
  +the host platform.  Example (unix):
  +precode
  +* org.apache.tomcat.common.classpath = /home/mypath/lib/mylib.jar: \
  +*  /home/mypath/classes/
  +/code/pre
  +

Re: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-02-26 Thread William Barker

This is a very nice feature.  Just for cleanliness, you might want to remove
the "tomcat.cp" property logic at line #426.
- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 1:42 AM
Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup
Main.java


 nacho   01/02/26 01:42:30

   Modified:src/share/org/apache/tomcat/startup Main.java
   Log:
   Added :

   org.apache.tomcat.common.classpath
   org.apache.tomcat.shared.classpath

   System properties to set the shared and common classpath, this are added
prior
   to adding the internal lib directories ..

   Submitted by Mel Martinez [[EMAIL PROTECTED]]

   Revision  ChangesPath
   1.26  +222 -85
jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java

   Index: Main.java
   ===
   RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
   retrieving revision 1.25
   retrieving revision 1.26
   diff -u -r1.25 -r1.26
   --- Main.java 2001/02/10 19:17:28 1.25
   +++ Main.java 2001/02/26 09:42:30 1.26
   @@ -1,4 +1,4 @@
   -/*
   +/* $Id: Main.java,v 1.26 2001/02/26 09:42:30 nacho Exp $
 * 
 *
 * The Apache Software License, Version 1.1
   @@ -69,22 +69,101 @@
import org.apache.tomcat.util.IntrospectionUtils;
import org.apache.tomcat.util.compat.Jdk11Compat;

   -// Depends:
   -// JDK1.1
   -// tomcat.util.IntrospectionUtils, util.compat

/**
   - * Starter for Tomcat.
   - *
   - * This is a replacement/enhancement for the .sh and .bat files - you
can
   - * use JDK1.2 "java -jar tomcat.jar", or ( for jdk 1.1 ) you just need
to
   - * include a single jar file in the classpath.
   - *
   - * @author Costin Manolache
   - * @author Ignacio J. Ortega
   - *
   + Starter class for Tomcat.
   + p
   + This is a replacement/enhancement for the .sh and .bat files - you can
   + use JDK1.2 "java -jar tomcat.jar", or ( for jdk 1.1 ) you just need to
   + include a single jar file in the classpath.
   + p
   + This class creates three class loader instances:
   + ol
   + lia 'common' loader to be the parent of both the server
   + container and also webapp loaders./li
   + lia 'shared' loader to load classes used by all webapps, but
   + not the servlet engine./i
   + lia 'server' loader exclusively for the tomcat servlet engine./li
   + /ol
   + Both the 'shared' loader and 'server' loader have the common loader as
   + the parent class loader.  The class path for each is assembled like
so:
   + ul
   + licommon - all elements of the
codeorg.apache.tomcat.common.classpath/code
   +   property plus all *.jar files found in
${TOMCAT_HOME}/lib/common/./li
   + lishared - all elements of the
codeorg.apache.tomcat.shared.classpath/code
   +   property plus all *.jar files found in
${TOMCAT_HOME}/lib/shared/./i
   + liserver - all jar files found in ${TOMCAT_HOME}/lib, plus the class
   +   folder ${TOMCAT_HOME}/classes and finally also the utility jar
   +   file ${JAVA_HOME}/lib/tools.jar./li
   + /ol
   + After creating the above class loaders, this class instantiates,
initializes
   + and starts an instance of the class
codeorg.apache.tomcat.startup.Tomcat/code.
   + p
   + @author Costin Manolache
   + @author Ignacio J. Ortega
   + @author Mel Martinez [EMAIL PROTECTED]
   + @version $Revision: 1.26 $ $Date: 2001/02/26 09:42:30 $
 */
public class Main {
   +
   +/**
   +name of configuration property to set (using the -D option
at
   +startup or via .properties file) to specify the classpath
   +to be used by the ClassLoader shared amongst all web
applications
   +(but not by the servlet container).  Specify this string as
   +normal file paths separated by the path.seperator delimiter
for
   +the host platform.  Example (unix):
   +precode
   +* org.apache.tomcat.shared.classpath =
/home/mypath/lib/mylib.jar: \
   +*
/home/mypath/classes/
   +/code/pre
   +*/
   +public static final String TOMCAT_SHARED_CLASSPATH_PROPERTY =
   +"org.apache.tomcat.shared.classpath";
   +
   +/**
   +the classpath shared among all web apps (in addition to any
   +jar files placed directly in $TOMCAT_HOME/lib/shared/).
   +*/
   +public static final String TOMCAT_SHARED_CLASSPATH;
   +
   +/**
   +name of configuration property to set (using the -D option
at
   +startup or via .properties file) to specify the classpath
   +to be used by the ClassLoader common to both the servlet
engine
   +and all web applications.  Specify this string as
   +normal file paths separated by the path.seperator delimit

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-02-10 Thread costin

costin  01/02/10 07:56:35

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  CVS did an automatic merge, and got one line wrong. Sorry for that.
  
  Now the build should work again.
  
  Revision  ChangesPath
  1.22  +2 -1  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Main.java 2001/02/10 08:12:41 1.21
  +++ Main.java 2001/02/10 15:56:33 1.22
  @@ -188,7 +188,8 @@
   
   URL[] sharedClassPath=getURLs(getClassPathV(getSharedDir()));
   URL[] commonClassPath=getURLs(getClassPathV(getCommonDir()));
  - // XXX Should be: JdkCompat.newClassLoaderInstance !!
ClassLoader commonCl= IntrospectionUtils.getURLClassLoader(commonClassPath , parentL );
  + // XXX Should be: JdkCompat.newClassLoaderInstance !!
  + ClassLoader commonCl= IntrospectionUtils.getURLClassLoader(commonClassPath 
, parentL );
ClassLoader sharedCl= IntrospectionUtils.getURLClassLoader(sharedClassPath 
, commonCl );
   ClassLoader serverCl= 
IntrospectionUtils.getURLClassLoader(serverClassPath , commonCl );
if( commonCl==null ) {
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-02-10 Thread costin

costin  01/02/10 08:13:33

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Use Jdk11Compat instead of introspection.
  
  Revision  ChangesPath
  1.23  +19 -20jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Main.java 2001/02/10 15:56:33 1.22
  +++ Main.java 2001/02/10 16:13:33 1.23
  @@ -66,13 +66,12 @@
   import java.util.*;
   import java.net.*;
   
  -// XXX This should be replaced by JdkCompat
  -import org.apache.tomcat.util.compat.SimpleClassLoader;
   import org.apache.tomcat.util.IntrospectionUtils;
  +import org.apache.tomcat.util.compat.Jdk11Compat;
   
   // Depends:
   // JDK1.1
  -// tomcat.util.IntrospectionUtils, SimpleClassLoader
  +// tomcat.util.IntrospectionUtils, util.compat
   
   /**
* Starter for Tomcat.
  @@ -167,7 +166,8 @@
return commonBase;
   }
   
  -
  +static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat();
  +
   void execute( String args[] ) throws Exception {
   
   try {
  @@ -182,30 +182,29 @@
   Vector serverUrlV =getClassPathV(getServerDir());
   for(int i=0; i  serverUrlV.size();i++)
   urlV.addElement(serverUrlV.elementAt(i));
  - urlV.addElement( new URL( "file", null , System.getProperty( "java.home" ) 
+"/../lib/tools.jar"));
  + urlV.addElement( new URL( "file", null ,
  +   System.getProperty( "java.home" ) +
  +   "/../lib/tools.jar"));
   URL[] serverClassPath=getURLs(urlV);
  -// ClassLoader for webapps it uses a shared dir as repository, distinct 
from lib
  +// ClassLoader for webapps it uses a shared dir as repository,
  + // distinct from lib
   
   URL[] sharedClassPath=getURLs(getClassPathV(getSharedDir()));
   URL[] commonClassPath=getURLs(getClassPathV(getCommonDir()));
  - // XXX Should be: JdkCompat.newClassLoaderInstance !!
  - ClassLoader commonCl= IntrospectionUtils.getURLClassLoader(commonClassPath 
, parentL );
  - ClassLoader sharedCl= IntrospectionUtils.getURLClassLoader(sharedClassPath 
, commonCl );
  -ClassLoader serverCl= 
IntrospectionUtils.getURLClassLoader(serverClassPath , commonCl );
  - if( commonCl==null ) {
  - commonCl=new SimpleClassLoader(commonClassPath, parentL);
  - sharedCl=new SimpleClassLoader(sharedClassPath, commonCl);
  - serverCl=new SimpleClassLoader(serverClassPath, commonCl);
  -}
  -
  -//System.out.println("commonCl:"+commonCl);
  -//System.out.println("sharedCl:"+sharedCl);
  -//System.out.println("serverCl:"+serverCl);
  +
  + ClassLoader commonCl=
  + jdk11Compat.newClassLoaderInstance(commonClassPath , parentL );
  + ClassLoader sharedCl=
  + jdk11Compat.newClassLoaderInstance(sharedClassPath ,commonCl );
  +ClassLoader serverCl=
  + jdk11Compat.newClassLoaderInstance(serverClassPath ,commonCl);
  +
Class cls=serverCl.loadClass("org.apache.tomcat.startup.Tomcat");
Object proxy=cls.newInstance();
   
   IntrospectionUtils.setAttribute( proxy,"args", args );
  -IntrospectionUtils.setAttribute( proxy,"parentClassLoader", sharedCl );
  +IntrospectionUtils.setAttribute( proxy,"parentClassLoader",
  +  sharedCl );
   IntrospectionUtils.execute(  proxy, "executeWithAttributes" );
return;
} catch( Exception ex ) {
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java Tomcat.java

2001-02-10 Thread costin

costin  01/02/10 08:45:19

  Modified:src/share/org/apache/tomcat/startup Main.java Tomcat.java
  Log:
  Remove println().
  
  Less output ( Guessed home is printed only on error - it'll be printed
  by tomcat a bit later, using the Log. ).
  
  XXX There are still 3-4 more printlns ( some in the .sh script),
  probably it'll be a good idea to remove them too )
  
  Revision  ChangesPath
  1.24  +2 -1  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Main.java 2001/02/10 16:13:33 1.23
  +++ Main.java 2001/02/10 16:45:18 1.24
  @@ -172,7 +172,7 @@
   
   try {
   homeDir=IntrospectionUtils.guessHome("tomcat.home", "tomcat.jar");
  -System.out.println("Guessed home=" + homeDir);
  + // System.out.println("Guessed home=" + homeDir);
   
ClassLoader parentL=this.getClass().getClassLoader();
//System.out.println("ParentL " + parentL );
  @@ -208,6 +208,7 @@
   IntrospectionUtils.execute(  proxy, "executeWithAttributes" );
return;
} catch( Exception ex ) {
  + System.out.println("Guessed home=" + homeDir);
ex.printStackTrace();
}
   }
  
  
  
  1.54  +0 -1  jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java
  
  Index: Tomcat.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- Tomcat.java   2001/02/10 16:38:16 1.53
  +++ Tomcat.java   2001/02/10 16:45:18 1.54
  @@ -149,7 +149,6 @@
   
   public void setAttribute(String s,Object o) {
   attributes.put(s,o);
  -//System.out.println(s+":"+o);
   }
   public void executeWithAttributes() throws Exception {
  String[] args=(String[])attributes.get("args");
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2001-02-08 Thread costin

costin  01/02/08 23:49:28

  Modified:src/share/org/apache/tomcat/startup Main.java
  Log:
  Removing printlns.
  
  Revision  ChangesPath
  1.19  +3 -3  jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java
  
  Index: Main.java
  ===
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Main.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- Main.java 2001/02/06 02:46:27 1.18
  +++ Main.java 2001/02/09 07:49:28 1.19
  @@ -193,9 +193,9 @@
serverCl=new SimpleClassLoader(serverClassPath, commonCl);
   }
   
  -System.out.println("commonCl:"+commonCl);
  -System.out.println("sharedCl:"+sharedCl);
  -System.out.println("serverCl:"+serverCl);
  +//System.out.println("commonCl:"+commonCl);
  +//System.out.println("sharedCl:"+sharedCl);
  +//System.out.println("serverCl:"+serverCl);
Class cls=serverCl.loadClass("org.apache.tomcat.startup.Tomcat");
Object proxy=cls.newInstance();
   
  
  
  

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




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2000-12-11 Thread costin

costin  00/12/11 16:42:50

  Modified:src/facade22/org/apache/tomcat/facade
Servlet22Interceptor.java ServletWrapper.java
WebXmlReader.java
   src/facade22/org/apache/tomcat/modules/facade22
JspInterceptor.java
   src/share/org/apache/tomcat/context ErrorHandler.java
   src/share/org/apache/tomcat/core Context.java Handler.java
   src/share/org/apache/tomcat/request AccessInterceptor.java
StaticInterceptor.java
   src/share/org/apache/tomcat/startup Main.java
  Log:
  First round of refactoring for Handler/ServletWrapper. Reorganized the code
  to make sure the right order of calls in the right state is enforced.
  
  It seems that Handler is still too complex, and a lot of servlet-specific code
  ( like handling of init, UnavailableException, etc) need to be moved in
  the right place ( ServletWrapper). The problem is that ServletWrapper is too
  complex.
  
  I'll start cleaning ServletWrapper and then move init/destroy - Handler will
  then be a very simple and maintainable class. I need your review on this one,
  please send comments if you find any problem.
  
  Revision  ChangesPath
  1.6   +4 -1  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java
  
  Index: Servlet22Interceptor.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Servlet22Interceptor.java 2000/11/02 21:51:39 1.5
  +++ Servlet22Interceptor.java 2000/12/12 00:42:40 1.6
  @@ -144,7 +144,10 @@
ServletWrapper sw=new ServletWrapper();
sw.setName( hN );
sw.setContext( ct.getContext() );
  - log( "Create handler ");
  + // *.jsp - jsp is a legacy default mapping  
  + if( ! "jsp".equals(hN) ) {
  + log( "Create handler " + hN);
  + }
ct.setHandler(sw);
ct.getContext().addServlet(  sw );
}
  
  
  
  1.14  +124 -143  
jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletWrapper.java
  
  Index: ServletWrapper.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/ServletWrapper.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- ServletWrapper.java   2000/12/08 23:18:29 1.13
  +++ ServletWrapper.java   2000/12/12 00:42:40 1.14
  @@ -124,8 +124,19 @@
   public String toString() {
if( path==null )
return "Servlet " + name + "(" + servletClassName  + ")";
  - return "Jsp " + name + "(" + path + ")";
  + return "Jsp " + name + "(" + path + "/" + servletClassName +  ")";
   }
  +
  +//  Configuration hook
  +
  +/** This method can called to add the servlet to the web application.
  + * ( typlically used from the config - WebXmlReader ).
  + */
  +public void addServlet(Context ctx) throws TomcatException {
  + context=ctx;
  + //  System.out.println("Adding servlet " + this );
  + context.addServlet( this );
  +}
   
   //  Servlet specific properties 
   public void setLoadOnStartUp( int level ) {
  @@ -170,17 +181,21 @@
   }
   
   public String getServletClass() {
  -return this.servletClassName;
  +return getServletClassName();
   }
   
   public String getServletClassName() {
  -return this.servletClassName;
  + if( servletClassName == null )
  + servletClassName=name;
  +return servletClassName;
   }
   
   public void setServletClassName(String servletClassName) {
servlet=null; // reset the servlet, if it was set
servletClass=null;
this.servletClassName=servletClassName;
  + if( debug0  path!=null)
  + log( "setServletClassName for jsp " + servletClassName);
   }
   public void setServletClass(String servletClassName) {
setServletClassName(servletClassName);
  @@ -191,7 +206,8 @@
if ( ex != null ) {
if ( ex instanceof UnavailableException 
! ((UnavailableException)ex).isPermanent()) {
  - // make updated UnavailableException, reporting a minimum of 1 second
  + // make updated UnavailableException, reporting a minimum
  + // of 1 second
int secs=1;
long moreWaitTime=unavailableTime - System.currentTimeMillis();
if( moreWaitTime  0 )
  @@ -204,7 +220,7 @@
   
   
   public void reload() {
  - if( initialized ) {
  + if( getState()==STATE_READY ) {
try {

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup Main.java

2000-11-29 Thread costin

costin  00/11/29 22:17:13

  Modified:.build.xml
   src/share/org/apache/tomcat/core ContextManager.java
   src/share/org/apache/tomcat/modules/session
SimpleSessionStore.java
   src/share/org/apache/tomcat/startup Main.java
  Log:
  Fix the build for JDK1.1
  
  Since it's expected that the optimizations will use more JDK1.2 features
  ( in optional modules, of course :-) we want to make sure that tomcat's
  core remains usable on JDK1.1 and the optimized code is indeed optional.
  
  The rule is simple - no JDK1.2 specific code in core, in the basic modules
  or in utils used by basic modules ( if you do, the nightly build should
  catch it ).
  
  Use
  exclude name="org/apache../MyJdk12Class.java" unless="jdk12.present" /
  for all the 1.2 modules ( and make sure they are not enabled by default
  in server.xml )
  
  XXX need an exclude/unless for server.xml
  
  Revision  ChangesPath
  1.96  +8 -5  jakarta-tomcat/build.xml
  
  Index: build.xml
  ===
  RCS file: /home/cvs/jakarta-tomcat/build.xml,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- build.xml 2000/11/12 17:30:04 1.95
  +++ build.xml 2000/11/30 06:17:11 1.96
  @@ -206,7 +206,7 @@
 /target
   
 !--  Webdav == --
  -  target name="dav" depends="init"
  +  target depends="init" if="jdk12.present" name="dav"
   javac destdir="${tomcat.build}/classes" debug="${debug}" 
optimize="${optimize}" deprecation="off" srcdir="src/webdav"
 classpath
pathelement location="${servlet22.jar}"/
  @@ -238,6 +238,7 @@
 include name="org/apache/tomcat/modules/**"/
 exclude name="org/apache/tomcat/request/Jdk12Interceptor.java" 
unless="jdk12.present"/
 exclude name="org/apache/tomcat/context/LoaderInterceptor1.java" 
unless="jdk12.present"/
  +  exclude name="org/apache/tomcat/context/LoaderInterceptor12.java" 
unless="jdk12.present"/
 exclude name="org/apache/tomcat/context/PolicyInterceptor.java" 
unless="jdk12.present"/
   /javac
   jar jarfile="${tomcat.build}/lib/tomcat_modules.jar" 
basedir="${tomcat.build}/classes" 
  @@ -256,6 +257,8 @@
pathelement location="${servlet22.jar}"/
 /classpath
 include name="org/apache/jasper/**"/
  +  exclude name="org/apache/jasper/servlet/JasperLoader12.java" 
  + unless="jdk12.present"/
   /javac
   copy todir="${tomcat.build}/classes/org/apache/jasper"
   fileset dir="src/share/org/apache/jasper"
  @@ -352,15 +355,15 @@
   copy todir="${tomcat.dist}"
   fileset dir="${tomcat.build}"/
   /copy
  -copy todir="${tomcat.dist}/src/org"
  +!-- copy todir="${tomcat.dist}/src/org"
   fileset dir="src/share/org"/
  -/copy
  +   /copy --
   copy tofile="${tomcat.dist}/lib/jaxp.jar" file="${jaxp}/jaxp.jar"/
   copy tofile="${tomcat.dist}/lib/parser.jar" file="${jaxp}/parser.jar"/
   copy tofile="${tomcat.dist}/lib/servlet.jar" file="${servlet.jar}"/
  -copy todir="${tomcat.dist}/src/org"
  +!-- copy todir="${tomcat.dist}/src/org"
   fileset dir="src/facade22/org"/
  -/copy
  +/copy --
   
   !-- Add Tomcat internal javadoc --
   mkdir dir="${tomcat.dist}/webapps/ROOT/javadoc"/
  
  
  
  1.151 +1 -1  
jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.150
  retrieving revision 1.151
  diff -u -r1.150 -r1.151
  --- ContextManager.java   2000/11/30 04:58:40 1.150
  +++ ContextManager.java   2000/11/30 06:17:12 1.151
  @@ -940,7 +940,7 @@
   // public final String getRandomClass() {
   // XXX XXX @deprecated - use  interceptor properties
   public final void setRandomClass(String randomClass) {
  -System.setProperty(RANDOM_CLASS_PROPERTY, randomClass);
  +System.getProperties().put(RANDOM_CLASS_PROPERTY, randomClass);
   }
   
   
  
  
  
  1.4   +2 -1  
jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java
  
  Index: SimpleSessionStore.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/session/SimpleSessionStore.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SimpleSessionStore.java   2000/11/22 00:21:24 1.3
  +++ SimpleSessionStore.java   2000/11/30 06:17:12 1.4
  @@ -115,7 +115,8 @@
   
   public final void setRandomClass(String randomClass) {
this.randomClass=randomClass;
  -