Re: Number of active session in Tomcat instance
Costin, after I get the specific Context object in org.apache.tomcat.core.Context. How can I get the SessionManager for that Context? thanks again. === realRequest = facadeM.getRealRequest(request); cm = realRequest.getContext().getContextManager(); Enumeration e = cm.getContexts(); while ( e.hasMoreElements() ){ Context con = (Context) e.nextElement(); //how to get sessionManager? int size = sessionMgr.getSessions().size(); } === --- [EMAIL PROTECTED] wrote: > Hi, > > What you can do is use ContextManager.getContexts(), > then for each context you can get its > SessionManager. > > > Costin > > > On Sat, 8 Sep 2001, chiu ming luk wrote: > > > Hi, > > I had asked this question before. But I didn't get > any > > reply. So I post this again in hope someone could > > help me getting number of active session currect > > Tomcat holds. > > > > The following code will return number of sessions > in a > > Context(web app) > > but not all the sessions in the whole JVM (tomcat > > instance). > > > > For example: > > if I call the class LocalMon in /admintool > context: > > /tomcat/webapps/admintool/WEB-INF/classes/LocalMon > > then it will only report # of sessions in > /admintool > > web application. > > > > Any way I can get the total number of sessions for > all > > web applications > > (context)? -OR- > > How to call LocalMon in /admintool context but > reports > > session on other > > context(web app)? > > > > My source file (class) return # of session and a > (jsp) > > is also > > attached. > > > > > === > > import java.util.Vector; > > import java.util.Enumeration; > > import java.io.File; > > import java.net.URL; > > import javax.servlet.http.*; > > > > import org.apache.tomcat.core.Request; > > import org.apache.tomcat.core.FacadeManager; > > import org.apache.tomcat.core.Context; > > import org.apache.tomcat.core.ContextManager; > > import org.apache.tomcat.util.RequestUtil; > > import org.apache.tomcat.session.StandardManager; > > > > public class LocalMon > > { > > private ContextManager cm; > > private Request realRequest; > > private StandardManager _sessionMgr; > > > > public void init( HttpServletRequest request ){ > > FacadeManager facadeM = > > (FacadeManager)request.getAttribute( > > FacadeManager.FACADE_ATTRIBUTE); > > realRequest = facadeM.getRealRequest(request); > > cm = > realRequest.getContext().getContextManager(); > > try{ > > int manager_note = cm.getNoteId( > > ContextManager.CONTAINER_NOTE, > > "tomcat.standardManager" ); > > _sessionMgr = > > > (StandardManager)realRequest.getContext().getContainer().getNote(manager_note); > > > > } catch( Exception ignored ){ > > } > > } > > > > public boolean initialized(){ > > return ( cm != null ); > > } > > > > public String getNumSessions(){ > > return( String.valueOf( > > _sessionMgr.getSessions().size() ) ); > > } > > } > > > == > > > > thanks a lot > > > > -cm > > > > > > __ > > Do You Yahoo!? > > Get email alerts & NEW webcam video instant > messaging with Yahoo! Messenger > > http://im.yahoo.com > __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com
Re: Number of active session in Tomcat instance
Hi, What you can do is use ContextManager.getContexts(), then for each context you can get its SessionManager. Costin On Sat, 8 Sep 2001, chiu ming luk wrote: > Hi, > I had asked this question before. But I didn't get any > reply. So I post this again in hope someone could > help me getting number of active session currect > Tomcat holds. > > The following code will return number of sessions in a > Context(web app) > but not all the sessions in the whole JVM (tomcat > instance). > > For example: > if I call the class LocalMon in /admintool context: > /tomcat/webapps/admintool/WEB-INF/classes/LocalMon > then it will only report # of sessions in /admintool > web application. > > Any way I can get the total number of sessions for all > web applications > (context)? -OR- > How to call LocalMon in /admintool context but reports > session on other > context(web app)? > > My source file (class) return # of session and a (jsp) > is also > attached. > > === > import java.util.Vector; > import java.util.Enumeration; > import java.io.File; > import java.net.URL; > import javax.servlet.http.*; > > import org.apache.tomcat.core.Request; > import org.apache.tomcat.core.FacadeManager; > import org.apache.tomcat.core.Context; > import org.apache.tomcat.core.ContextManager; > import org.apache.tomcat.util.RequestUtil; > import org.apache.tomcat.session.StandardManager; > > public class LocalMon > { > private ContextManager cm; > private Request realRequest; > private StandardManager _sessionMgr; > > public void init( HttpServletRequest request ){ > FacadeManager facadeM = > (FacadeManager)request.getAttribute( > FacadeManager.FACADE_ATTRIBUTE); > realRequest = facadeM.getRealRequest(request); > cm = realRequest.getContext().getContextManager(); > try{ > int manager_note = cm.getNoteId( > ContextManager.CONTAINER_NOTE, > "tomcat.standardManager" ); > _sessionMgr = > (StandardManager)realRequest.getContext().getContainer().getNote(manager_note); > > } catch( Exception ignored ){ > } > } > > public boolean initialized(){ > return ( cm != null ); > } > > public String getNumSessions(){ > return( String.valueOf( > _sessionMgr.getSessions().size() ) ); > } > } > == > > thanks a lot > > -cm > > > __ > Do You Yahoo!? > Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger > http://im.yahoo.com
Number of active session in Tomcat instance
Hi, I had asked this question before. But I didn't get any reply. So I post this again in hope someone could help me getting number of active session currect Tomcat holds. The following code will return number of sessions in a Context(web app) but not all the sessions in the whole JVM (tomcat instance). For example: if I call the class LocalMon in /admintool context: /tomcat/webapps/admintool/WEB-INF/classes/LocalMon then it will only report # of sessions in /admintool web application. Any way I can get the total number of sessions for all web applications (context)? -OR- How to call LocalMon in /admintool context but reports session on other context(web app)? My source file (class) return # of session and a (jsp) is also attached. === import java.util.Vector; import java.util.Enumeration; import java.io.File; import java.net.URL; import javax.servlet.http.*; import org.apache.tomcat.core.Request; import org.apache.tomcat.core.FacadeManager; import org.apache.tomcat.core.Context; import org.apache.tomcat.core.ContextManager; import org.apache.tomcat.util.RequestUtil; import org.apache.tomcat.session.StandardManager; public class LocalMon { private ContextManager cm; private Request realRequest; private StandardManager _sessionMgr; public void init( HttpServletRequest request ){ FacadeManager facadeM = (FacadeManager)request.getAttribute( FacadeManager.FACADE_ATTRIBUTE); realRequest = facadeM.getRealRequest(request); cm = realRequest.getContext().getContextManager(); try{ int manager_note = cm.getNoteId( ContextManager.CONTAINER_NOTE, "tomcat.standardManager" ); _sessionMgr = (StandardManager)realRequest.getContext().getContainer().getNote(manager_note); } catch( Exception ignored ){ } } public boolean initialized(){ return ( cm != null ); } public String getNumSessions(){ return( String.valueOf( _sessionMgr.getSessions().size() ) ); } } == thanks a lot -cm __ Do You Yahoo!? Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger http://im.yahoo.com LocalMon.java
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs jndi-resources-howto.xml
craigmcc01/09/08 21:00:09 Modified:.BUILDING.txt build.properties.sample catalina build.xml catalina/src/conf server.xml webapps/examples build.xml webapps/examples/WEB-INF web.xml webapps/examples/jsp index.html webapps/tomcat-docs jndi-resources-howto.xml Added: webapps/examples/WEB-INF/classes SendMailServlet.java webapps/examples/jsp/mail sendmail.html sendmail.jsp sendmail.txt Log: Update the "JNDI Resources" documentation to describe the resource factory for javax.mail.Session objects. Add an example page and servlet to illustrate the use of this feature, and update the build process accordingly. WARNING: The build process now requires that the Java Activation Framework and JavaMail package distributions be available, and "activation.jar" and "mail.jar" are now included automatically in the Tomcat binary build (in directory $CATALINA_HOME/common/lib). Revision ChangesPath 1.2 +33 -9 jakarta-tomcat-4.0/BUILDING.txt Index: BUILDING.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/BUILDING.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- BUILDING.txt 2001/07/27 22:26:03 1.1 +++ BUILDING.txt 2001/09/09 04:00:07 1.2 @@ -1,4 +1,4 @@ -$Id: BUILDING.txt,v 1.1 2001/07/27 22:26:03 craigmcc Exp $ +$Id: BUILDING.txt,v 1.2 2001/09/09 04:00:07 craigmcc Exp $ Building The Tomcat 4.0 Servlet/JSP Container @@ -208,8 +208,27 @@ it resides in its own subdirectory. -(10) Download and Install the JSSE 1.0.2 Reference Implementation +(10) Download and Install the Java Activation Framework 1.0.1 +* Download the Java Activation Framework package (version 1.0.1 or later) from + +http://java.sun.com/products/javabeans/glasgow/jaf.html + +* Unpack the package into a convenient location so that it + resised in its own subdirectory. + +(11) Download and Install JavaMail 1.2 + +* Download the JavaMail package (version 1.2 or later) from + +http://java.sun.com/products/javamail/index.html + +* Unpack the package into a convenient location so that + it resides in its own subdirectory. + + +(12) Download and Install the JSSE 1.0.2 Reference Implementation + * Download the Java Secure Sockets Extension (JSSE) package, (version 1.0.2 or later) from @@ -219,7 +238,7 @@ it resides in its own subdirectory. -(11) Download and Install the Java Transaction APIs (OPTIONAL) +(13) Download and Install the Java Transaction APIs (OPTIONAL) NOTE: This step is only required if you wish to build the Tyrex connection pool implementation for JNDI-accessed data sources. @@ -232,7 +251,7 @@ own subdirectory. -(12) Download and Install the JUnit Testing Package (OPTIONAL) +(14) Download and Install the JUnit Testing Package (OPTIONAL) NOTE: This step is only required if you wish to build and execute the unit tests that are part of the Tomcat 4.0 source base. @@ -245,7 +264,7 @@ own subdirectory. -(13) Download and Install the Tyrex Data Source Package (OPTIONAL) +(15) Download and Install the Tyrex Data Source Package (OPTIONAL) NOTE: This step is only required if you wish to build the Tyrex connection pool implementation for JNDI-accessed data sources. @@ -258,7 +277,7 @@ own subdirectory. -(13) Customize Build Properties For This Subproject +(16) Customize Build Properties For This Subproject Most Jakarta subprojects allow you to customize Ant properties (with default values defined in the "build.xml" file. This is done by creating a text file @@ -274,6 +293,9 @@ Property Name Description + activation.home Pathname to directory containing the Java Activation +Framework package, version 1.0.1 or later + jmx.home Pathname to directory containing the Java Management Extensions (JMX) Reference Implementation, version 1.0 or later @@ -289,21 +311,23 @@ junit.jar Pathname to the "junit.jar" file from JUnit, version 3.7 or later + mail.home Pathname to the directory containing the JavaMail package, +version 1.2 or later + regexp.home Pathname to directory containing a binary distribution of the Jakarta Regexp Project, version 1.2 servletapi.home Pathname to directory containing a binary distribution of the Servlet 2.3/JSP 1.2 API classes -FIXME: Properties for mail.jar, acti
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/http Parameters.java
costin 01/09/08 20:14:41 Modified:src/share/org/apache/tomcat/util/http Parameters.java Log: Bug 3479: parameter parsing with a&b&c syntax ( no '=' ). Revision ChangesPath 1.17 +64 -14 jakarta-tomcat/src/share/org/apache/tomcat/util/http/Parameters.java Index: Parameters.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/http/Parameters.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Parameters.java 2001/08/31 04:13:11 1.16 +++ Parameters.java 2001/09/09 03:14:41 1.17 @@ -359,13 +359,30 @@ log( "Bytes: " + new String( bytes, start, len )); do { + boolean noEq=false; + int valStart=-1; + int valEnd=-1; + int nameStart=pos; int nameEnd=ByteChunk.indexOf(bytes, nameStart, end, '=' ); - if( nameEnd== -1 ) nameEnd=end; - - int valStart=nameEnd+1; - int valEnd=ByteChunk.indexOf(bytes, valStart, end, '&'); - if( valEnd== -1 ) valEnd = (valStart < end) ? end : valStart; + // Workaround for a&b&c encoding + int nameEnd2=ByteChunk.indexOf(bytes, nameStart, end, '&' ); + if( (nameEnd2!=-1 ) && + ( nameEnd==-1 || nameEnd > nameEnd2) ) { + nameEnd=nameEnd2; + noEq=true; + valStart=nameEnd; + valEnd=nameEnd; + if( debug>0) log("no equal " + nameStart + " " + nameEnd + " " + new String(bytes, nameStart, nameEnd-nameStart) ); + } + if( nameEnd== -1 ) + nameEnd=end; + + if( ! noEq ) { + valStart=nameEnd+1; + valEnd=ByteChunk.indexOf(bytes, valStart, end, '&'); + if( valEnd== -1 ) valEnd = (valStart < end) ? end : valStart; + } pos=valEnd+1; @@ -381,7 +398,7 @@ try { if( debug > 0 ) - log( tmpName + "= " + tmpValue); + log( "Found " + tmpName + "= " + tmpValue); if( urlDec==null ) { urlDec=new UDecoder(); @@ -390,7 +407,7 @@ urlDec.convert( tmpValue ); if( debug > 0 ) - log( tmpName + "= " + tmpValue); + log( "After url decoding " + tmpName + "= " + tmpValue); addParam( tmpName.toString(), tmpValue.toString() ); } catch( IOException ex ) { @@ -410,13 +427,29 @@ if( debug>0 ) log( "Chars: " + new String( chars, start, len )); do { + boolean noEq=false; int nameStart=pos; + int valStart=-1; + int valEnd=-1; + int nameEnd=CharChunk.indexOf(chars, nameStart, end, '=' ); + int nameEnd2=CharChunk.indexOf(chars, nameStart, end, '&' ); + if( (nameEnd2!=-1 ) && + ( nameEnd==-1 || nameEnd > nameEnd2) ) { + nameEnd=nameEnd2; + noEq=true; + valStart=nameEnd; + valEnd=nameEnd; + if( debug>0) log("no equal " + nameStart + " " + nameEnd + " " + new String(chars, nameStart, nameEnd-nameStart) ); + } if( nameEnd== -1 ) nameEnd=end; - - int valStart=nameEnd+1; - int valEnd=CharChunk.indexOf(chars, valStart, end, '&'); - if( valEnd== -1 ) valEnd = (valStart < end) ? end : valStart; + + if( ! noEq ) { + valStart=nameEnd+1; + valEnd=CharChunk.indexOf(chars, valStart, end, '&'); + if( valEnd== -1 ) valEnd = (valStart < end) ? end : valStart; + } + pos=valEnd+1; if( nameEnd<=nameStart ) { @@ -501,13 +534,30 @@ log("String: " + str ); do { + boolean noEq=false; + int valStart=-1; + int valEnd=-1; + int nameStart=pos; int nameEnd=str.indexOf('=', nameStart ); + int nameEnd2=str.indexOf('&', nameStart ); + if( (nameEnd2!=-1 ) && + ( nameEnd==-1 || nameEnd > nameEnd2) ) { + nameEnd=nameEnd2; + noEq=true; + valStart=nameEnd; + valEnd=nameEnd; + if( debug>0) log("no equal " + nameStart + " " + nameEnd + " " + str.substring(nameStart, nameEnd) ); + } + if( nameEnd== -1 ) nameEnd=end; - int valStart=nameEnd+1; - int valEnd=str.indexOf('&', valStart); - if( valEnd== -1 ) valEnd = (valStart < end) ? end : valStart; + if( ! noEq ) { + valStart=nameEnd+1; + valEnd=str.indexOf
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup EmbededTomcat.java
costin 01/09/08 19:01:56 Modified:src/share/org/apache/tomcat/startup EmbededTomcat.java Log: Bug 3483: install.dir and home.dir not working as expected ( however setting tomcat.home in server.xml did work fine - and is the best way to set multi-homed tomcat ). Bug reported by Ben Kelley Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.54 +6 -7 jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java Index: EmbededTomcat.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- EmbededTomcat.java2001/09/09 00:46:28 1.53 +++ EmbededTomcat.java2001/09/09 02:01:56 1.54 @@ -22,7 +22,7 @@ lib/common, and without lib/container. It'll deal with setting a separate class loader for container and applications. - - home property must be set, or TOMCAT_HOME env. + - tomcat.install or tomcat.home property must be set ( from TOMCAT_HOME env.) */ @@ -388,15 +388,14 @@ if( initialized ) return; if( home==null ) home = System.getProperty("tomcat.home"); - if( home==null ) { - IntrospectionUtils.guessInstall("tomcat.install", - "tomcat.home","tomcat.jar"); - home = System.getProperty("tomcat.home"); - if( dL > 0 ) debug( "Guessed home " + home ); + if( installDir==null ) { + installDir=IntrospectionUtils.guessInstall("tomcat.install", +"tomcat.home","tomcat.jar"); + if( dL > 0 ) debug( "Guessed installDir " + installDir ); } - contextM.setHome( home ); if( installDir==null ) installDir=home; + contextM.setInstallDir( installDir ); try { setTomcatProperties();
cvs commit: jakarta-tomcat-4.0/webapps/examples/jsp/mail - New directory
craigmcc01/09/08 18:54:10 jakarta-tomcat-4.0/webapps/examples/jsp/mail - New directory
cvs commit: jakarta-tomcat-4.0/webapps/tomcat-docs/config context.xml defaultcontext.xml
craigmcc01/09/08 17:48:11 Modified:.RELEASE-NOTES-4.0-B8.txt RELEASE-PLAN-4.0.txt catalina/src/share/org/apache/catalina/core StandardContext.java catalina/src/share/org/apache/catalina/deploy ApplicationParameter.java ContextEnvironment.java webapps/tomcat-docs index.xml project.xml webapps/tomcat-docs/config context.xml defaultcontext.xml Added: webapps/tomcat-docs jndi-resources-howto.xml Log: Add the half-completed "jndi-resources-howto.xml" that talks about how to configure and elements in server.xml. Make the handling of the "override" property on and elements match the documentation (now that it exists :-). TODO: Document the standard resource factories supported by Tomcat 4, and the process for adding your own custom resource factories. Revision ChangesPath 1.4 +29 -1 jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B8.txt Index: RELEASE-NOTES-4.0-B8.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/RELEASE-NOTES-4.0-B8.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RELEASE-NOTES-4.0-B8.txt 2001/08/14 18:50:09 1.3 +++ RELEASE-NOTES-4.0-B8.txt 2001/09/09 00:48:11 1.4 @@ -3,7 +3,7 @@ Release Notes = -$Id: RELEASE-NOTES-4.0-B8.txt,v 1.3 2001/08/14 18:50:09 pier Exp $ +$Id: RELEASE-NOTES-4.0-B8.txt,v 1.4 2001/09/09 00:48:11 craigmcc Exp $ @@ -128,6 +128,10 @@ directory of your web application, this should now be possible, because of the modified JAXP 1.1 parser mentioned below. +* Make sure you do *not* place an XML parser in your Java system extensions + directory ($JAVA_HOME/jre/lib/ext), or modify the startup scripts to include + such a parser in the CLASSPATH under which Tomcat executes. + WARNING: Tomcat 4.0 now ships with a modified version of the JAXP/1.1 (Final) "jaxp.jar" and "crimson.jar" files in the "jasper" subdirectory. The "sealed" attribute has been removed from the manifest file for these @@ -177,3 +181,27 @@ * There are several test failures in the "tester" unit test suite that will be corrected before final release. (Most of these issues related to the bug that prevents BASIC authentication form operating.) + + +- +Tomcat 4.0 and JNI Based Applications: +- + +Applications that require native libraries must ensure that the libraries have +been loaded prior to use. Typically, this is done with a call like: + + static { +System.loadLibrary("path-to-library-file"); + } + +in some class. However, the application must also ensure that the library is +not loaded more than once. If the above code were placed in a class inside +the web application (i.e. under /WEB-INF/classes or /WEB-INF/lib), and the +application were reloaded, the loadLibrary() call would be attempted a second +time. + +To avoid this problem, place classes that load native libraries outside of the +web application, and ensure that the loadLibrary() call is executed only once +during the lifetime of a particular JVM. + + 1.10 +6 -32 jakarta-tomcat-4.0/RELEASE-PLAN-4.0.txt Index: RELEASE-PLAN-4.0.txt === RCS file: /home/cvs/jakarta-tomcat-4.0/RELEASE-PLAN-4.0.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- RELEASE-PLAN-4.0.txt 2001/09/07 04:13:42 1.9 +++ RELEASE-PLAN-4.0.txt 2001/09/09 00:48:11 1.10 @@ -1,4 +1,4 @@ -$Id: RELEASE-PLAN-4.0.txt,v 1.9 2001/09/07 04:13:42 remm Exp $ +$Id: RELEASE-PLAN-4.0.txt,v 1.10 2001/09/09 00:48:11 craigmcc Exp $ Release Plan for Apache Tomcat 4.0 == @@ -21,11 +21,11 @@ This Release Plan proposes the following schedule: - Monday, September 9, 2001 Tomcat 4.0 Release Candidate 1 + Sunday, September 9, 2001 Tomcat 4.0 Release Candidate 1 - Thursday, September 12, 2001 Tomcat 4.0 Release Candidate 2 + Wednesday, September 12, 2001 Tomcat 4.0 Release Candidate 2 - Monday, September 17, 2001 Tomcat 4.0 Final Release + Monday, September 17, 2001 Tomcat 4.0 Final Release In order to complete final release, all outstanding Bugzilla bug reports against Tomcat 4.0 need to be fixed or deferred for later releases. This @@ -46,10 +46,6 @@ Bugs That Must Be Addressed Before Final Release: -Catalina2883Error page for 401 error code is not populated -
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/startup EmbededTomcat.java Main.java
costin 01/09/08 17:46:28 Modified:src/share/org/apache/tomcat/startup EmbededTomcat.java Main.java Log: Bug 3498 - revert to the documented system properties for the classpath. Thanks [EMAIL PROTECTED] (Arun Katkere) for noticing this. Revision ChangesPath 1.53 +5 -2 jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java Index: EmbededTomcat.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/EmbededTomcat.java,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- EmbededTomcat.java2001/09/07 04:25:20 1.52 +++ EmbededTomcat.java2001/09/09 00:46:28 1.53 @@ -668,10 +668,13 @@ // Class loader methods static final Jdk11Compat jdk11Compat=Jdk11Compat.getJdkCompat(); +/** System property used to set the application class loader, which + will be the parent of all webapps. +*/ public static final String PROPERTY_APPS_LOADER = - "org.apache.tomcat.apps.loader"; + "org.apache.tomcat.apps.classpath"; public static final String PROPERTY_CONTAINER_LOADER = - "org.apache.tomcat.container.loader"; + "org.apache.tomcat.container.classpath"; /** Initialize class loaders with the defaults, if not set 1.41 +8 -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.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- Main.java 2001/09/07 04:25:20 1.40 +++ Main.java 2001/09/09 00:46:28 1.41 @@ -1,4 +1,4 @@ -/* $Id: Main.java,v 1.40 2001/09/07 04:25:20 costin Exp $ +/* $Id: Main.java,v 1.41 2001/09/09 00:46:28 costin Exp $ * * * The Apache Software License, Version 1.1 @@ -94,8 +94,14 @@ * @author Mel Martinez [EMAIL PROTECTED] */ public class Main{ +/** System property that can be used to pass additional classpath + to the 'common' loader, used to load EmbededTomcat and the + core. EmbededTomcat will load the container int a separate + loader, and each applications will be set up int its own loader. + The loader configurator module may use additional properties +*/ public static final String PROPERTY_COMMON_LOADER = - "org.apache.tomcat.common.loader"; + "org.apache.tomcat.common.classpath"; String installDir; String libDir;
cvs commit: jakarta-tomcat/src/tests/webpages/jsp bigDeclaration.jsp
larryi 01/09/08 16:41:30 Modified:src/tests/webpages/jsp bigDeclaration.jsp Log: Fix so Jikes won't generate a compile error. Revision ChangesPath 1.3 +2 -2 jakarta-tomcat/src/tests/webpages/jsp/bigDeclaration.jsp Index: bigDeclaration.jsp === RCS file: /home/cvs/jakarta-tomcat/src/tests/webpages/jsp/bigDeclaration.jsp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- bigDeclaration.jsp2000/01/15 18:38:36 1.2 +++ bigDeclaration.jsp2001/09/08 23:41:30 1.3 @@ -387,12 +387,12 @@ while (true) { switch (tokenStream.nextToken()) { - case tokenStream.TT_EOF: + case StreamTokenizer.TT_EOF: dataStream.close(); return; default: break; - case tokenStream.TT_NUMBER: + case StreamTokenizer.TT_NUMBER: target.setTransientValue((float)tokenStream.nval); if (! target.app.isStopped && ! target.paused) { target.app.repaint();
cvs commit: jakarta-tomcat/src/facade22/org/apache/tomcat/facade JspInterceptor.java
larryi 01/09/08 16:40:24 Modified:src/facade22/org/apache/tomcat/facade JspInterceptor.java Log: For Jikes compilation, add a jikesClasspath property to JspInterceptor to be included in Jikes' classpath. This setting is passed to JasperLiason via a "jikes.class.path" system property. Also, for Java2, automatically include "jre/lib/rt.jar" in Jikes' classpath. Revision ChangesPath 1.28 +22 -1 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java Index: JspInterceptor.java === RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/JspInterceptor.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- JspInterceptor.java 2001/07/20 13:05:39 1.27 +++ JspInterceptor.java 2001/09/08 23:40:24 1.28 @@ -186,6 +186,15 @@ public void setProperty( String n, String v ) { args.put( n, v ); } + +public void setJikesClasspath( String cp ) { +if( cp != null ) { +System.getProperties().put("jikes.class.path", cp); +if( debug > 0 ) +log("Setting jikes.class.path to " + cp); +} +} + // JspInterceptor properties /** Use the old JspServlet to execute Jsps, instead of the @@ -701,7 +710,19 @@ javac.setClassDebugInfo(options.getClassDebugInfo()); javac.setEncoding(javaEncoding); - String cp=System.getProperty("java.class.path")+ sep + + +String cp=""; +if( javac instanceof JikesJavaCompiler ) { +if( !System.getProperty("java.version").startsWith("1.1") ) { +cp=System.getProperty("java.home") + File.separator + +"lib" + File.separator + "rt.jar" + sep; +} +String jikesCP = System.getProperty("jikes.class.path"); +if( jikesCP != null && jikesCP.length() > 0 ) + cp+=jikesCP + sep; +} + + cp+=System.getProperty("java.class.path")+ sep + ctxt.getClassPath() + sep + ctxt.getOutputDir(); javac.setClasspath( cp ); javac.setOutputDir(ctxt.getOutputDir());
RE: [VOTE] Release Plan for Apache Tomcat 4.0 (final release)
+0
cvs commit: jakarta-tomcat/src/share/org/apache/jasper JspC.java
marcsaeg01/09/08 13:54:51 Modified:src/share/org/apache/jasper Tag: tomcat_32 JspC.java Log: Fixes invalid servlet mapping in generated web.xml file. PR: 3474, 3499 Submitted by: Blakeslee, Todd [[EMAIL PROTECTED]] Revision ChangesPath No revision No revision 1.15.2.4 +7 -7 jakarta-tomcat/src/share/org/apache/jasper/JspC.java Index: JspC.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v retrieving revision 1.15.2.3 retrieving revision 1.15.2.4 diff -u -r1.15.2.3 -r1.15.2.4 --- JspC.java 2001/01/12 04:46:58 1.15.2.3 +++ JspC.java 2001/09/08 20:54:51 1.15.2.4 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.15.2.3 2001/01/12 04:46:58 larryi Exp $ - * $Revision: 1.15.2.3 $ - * $Date: 2001/01/12 04:46:58 $ + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v 1.15.2.4 2001/09/08 20:54:51 marcsaeg Exp $ + * $Revision: 1.15.2.4 $ + * $Date: 2001/09/08 20:54:51 $ * * * @@ -391,11 +391,11 @@ servletout.write("\n\t\n"); } if (mappingout != null) { -mappingout.write("\n\t\n\t\t"); -mappingout.write(file); -mappingout.write("\n\t\t"); +mappingout.write("\n\t\n\t\t"); mappingout.write(thisServletName); -mappingout.write("\n\t\n"); +mappingout.write("\n\t\t"); +mappingout.write(file.replace('\\', '/')); +mappingout.write("\n\t\n"); } return true; } catch (JasperException je) {
cvs commit: jakarta-tomcat-connectors/jk/native/jni jk_jnicb.c
costin 01/09/08 13:28:56 Modified:jk/native/jni jk_jnicb.c Log: Update from main branch. ( Mike's patch ) Revision ChangesPath 1.3 +13 -13jakarta-tomcat-connectors/jk/native/jni/jk_jnicb.c Index: jk_jnicb.c === RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/jni/jk_jnicb.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- jk_jnicb.c2001/06/18 14:46:19 1.2 +++ jk_jnicb.c2001/09/08 20:28:56 1.3 @@ -58,7 +58,7 @@ /*** * Description: JNI callbacks implementation for the JNI in process adapter* * Author: Gal Shachor <[EMAIL PROTECTED]> * - * Version: $Revision: 1.2 $ * + * Version: $Revision: 1.3 $ * ***/ #include "jk_jnicb.h" @@ -67,12 +67,12 @@ #include "jk_pool.h" /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:getNumberOfHeaders * Signature: (JJ)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_getNumberOfHeaders +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_getNumberOfHeaders (JNIEnv *env, jobject o, jlong s, jlong l) { /* [V] Convert indirectly from jlong -> int -> pointer to shut up gcc */ @@ -96,12 +96,12 @@ } /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:read * Signature: (JJ[BII)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_read +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_read (JNIEnv *env, jobject o, jlong s, jlong l, jbyteArray buf, jint from, jint cnt) { jk_ws_service_t *ps = (jk_ws_service_t *)(int)s; @@ -143,12 +143,12 @@ } /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:readEnvironment * Signature: (JJ[Ljava/lang/String;)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_readEnvironment +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_readEnvironment (JNIEnv *env, jobject o, jlong s, jlong l, jobjectArray envbuf) { jk_ws_service_t *ps = (jk_ws_service_t *)(int)s; @@ -290,12 +290,12 @@ } /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:readHeaders * Signature: (JJ[Ljava/lang/String;[Ljava/lang/String;)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_readHeaders +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_readHeaders (JNIEnv *env, jobject o, jlong s, jlong l, jobjectArray hnames, jobjectArray hvalues) { jk_ws_service_t *ps = (jk_ws_service_t *)(int)s; @@ -332,12 +332,12 @@ } /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:startReasponse * Signature: (JJILjava/lang/String;[Ljava/lang/String;[Ljava/lang/String;I)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_startReasponse +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_startReasponse (JNIEnv *env, jobject o, jlong s, jlong l, jint sc, jstring msg, jobjectArray hnames, jobjectArray hvalues, jint hcnt) { @@ -457,12 +457,12 @@ } /* - * Class: org_apache_tomcat_service_connector_JNIConnectionHandler + * Class: org_apache_tomcat_modules_server_JNIConnectionHandler * Method:write * Signature: (JJ[BII)I */ JNIEXPORT jint JNICALL -Java_org_apache_tomcat_service_connector_JNIConnectionHandler_write +Java_org_apache_tomcat_modules_server_JNIConnectionHandler_write (JNIEnv *env, jobject o, jlong s, jlong l, jbyteArray buf, jint from, jint cnt) { jk_ws_service_t *ps = (jk_ws_service_t *)(int)s;
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config AutoDeploy.java
costin 01/09/08 13:14:11 Modified:src/share/org/apache/tomcat/modules/config AutoDeploy.java Log: Expand the WAR files earlier. This reduce the ordering problems - modules can expect the apps to be deployed on addContext. Note that expanding .war files declared in server.xml is not supported ( and never worked ). This feature can be added later by another module. Revision ChangesPath 1.6 +9 -3 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoDeploy.java Index: AutoDeploy.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoDeploy.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- AutoDeploy.java 2001/04/22 05:37:31 1.5 +++ AutoDeploy.java 2001/09/08 20:14:11 1.6 @@ -129,14 +129,20 @@ // Implementation /** - * Find all wars, expand them, register dependency. + * Find all wars and expand them. + * Do this as early as possible - we don't need anything from the engine. */ -public void engineInit(ContextManager cm) throws TomcatException { - +public void addInterceptor(ContextManager cm, Context ctx, +BaseInterceptor module) + throws TomcatException +{ + // checkHooks(cm, ctx, module); + if( this != module ) return; // For all contexts in or loaded by differen means, // check if the docBase ends with .war - and expand it if so, // after that replace the docBase with the dir. See bug 427. /* XXX not ready yet. +// XXX Should be done on addContext hook too Enumeration loadedCtx=cm.getContexts(); while( loadedCtx.hasMoreElements() ) { Context ctx=(Context)loadedCtx.nextElement();
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config ContextXmlReader.java
larryi 01/09/08 13:13:19 Modified:src/share/org/apache/tomcat/modules/config ContextXmlReader.java Log: Fix bug where host_aliases doesn't get cleared. If more than one is specified in a file, the last one will get all the aliases previously specified. This includes aliases in prior definitions. Revision ChangesPath 1.10 +1 -0 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ContextXmlReader.java Index: ContextXmlReader.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/ContextXmlReader.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ContextXmlReader.java 2001/08/16 04:52:56 1.9 +++ ContextXmlReader.java 2001/09/08 20:13:19 1.10 @@ -154,6 +154,7 @@ // Virtual host support - if Context is inside a xh.addRule( "Host", xh.setVar( "current_host", "name")); xh.addRule( "Host", xh.setVar( "current_address", "address")); + xh.addRule( "Host", xh.setVar( "host_aliases", "")); // so host_aliases will get reset xh.addRule( "Host", xh.setProperties()); xh.addRule( "Alias", new XmlAction() { public void start( SaxContext xctx) throws Exception {
cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java
larryi 01/09/08 13:11:00 Modified:src/share/org/apache/tomcat/modules/config LoaderInterceptor11.java Log: Make useNoParent take priority over useAppsL. This shouldn't hurt usability and is more straightforward to document. Revision ChangesPath 1.18 +4 -4 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LoaderInterceptor11.java Index: LoaderInterceptor11.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/LoaderInterceptor11.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- LoaderInterceptor11.java 2001/08/21 04:58:22 1.17 +++ LoaderInterceptor11.java 2001/09/08 20:11:00 1.18 @@ -207,12 +207,12 @@ } ClassLoader parent=null; - if( useAppsL && !context.isTrusted() ) { - if( debug > 0 ) log( "Using webapp loader " + context.isTrusted()); - parent=cm.getAppsLoader(); - } else if( useNoParent ) { + if( useNoParent ) { if( debug > 0 ) log( "Using no parent loader "); parent=null; + } else if( useAppsL && !context.isTrusted() ) { + if( debug > 0 ) log( "Using webapp loader " + context.isTrusted()); + parent=cm.getAppsLoader(); } else { if( debug > 0 ) log( "Using container loader "); parent=this.getClass().getClassLoader();
cvs commit: jakarta-tomcat/src/share/org/apache/jasper JspC.java
costin 01/09/08 13:09:39 Modified:src/share/org/apache/jasper JspC.java Log: Bug 3507, thanks to [EMAIL PROTECTED] Submitted by: [EMAIL PROTECTED] Revision ChangesPath 1.23 +4 -4 jakarta-tomcat/src/share/org/apache/jasper/JspC.java Index: JspC.java === RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/jasper/JspC.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -r1.22 -r1.23 --- JspC.java 2001/04/28 21:13:36 1.22 +++ JspC.java 2001/09/08 20:09:39 1.23 @@ -395,11 +395,11 @@ servletout.write("\n\t\n"); } if (mappingout != null) { -mappingout.write("\n\t\n\t\t"); -mappingout.write(file); -mappingout.write("\n\t\t"); +mappingout.write("\n\t\n\t\t"); mappingout.write(thisServletName); -mappingout.write("\n\t\n"); +mappingout.write("\n\t\t"); +mappingout.write(file); +mappingout.write("\n\t\n"); } return true; } catch (JasperException je) {
cvs commit: jakarta-tomcat/src/etc server.xml
larryi 01/09/08 13:08:31 Modified:src/etc server.xml Log: Remove JspInterceptor "sendErrToClient" option. I couldn't find where Jasper does anything with this option at this point. I plan on leaving it out of the documentation. Revision ChangesPath 1.90 +0 -1 jakarta-tomcat/src/etc/server.xml Index: server.xml === RCS file: /home/cvs/jakarta-tomcat/src/etc/server.xml,v retrieving revision 1.89 retrieving revision 1.90 diff -u -r1.89 -r1.90 --- server.xml2001/09/03 02:18:03 1.89 +++ server.xml2001/09/08 20:08:31 1.90 @@ -75,7 +75,6 @@
cvs commit: jakarta-tomcat/src/native/mod_jk/apache1.3 mod_jk.c
larryi 01/09/08 13:04:28 Modified:src/native/mod_jk/apache1.3 mod_jk.c Log: The fix to add a content-length:0 altered the desired behavior when is_chunked is true. Restore prior chunked behavior. Revision ChangesPath 1.14 +1 -1 jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c Index: mod_jk.c === RCS file: /home/cvs/jakarta-tomcat/src/native/mod_jk/apache1.3/mod_jk.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- mod_jk.c 2001/09/05 09:32:39 1.13 +++ mod_jk.c 2001/09/08 20:04:28 1.14 @@ -485,7 +485,7 @@ s->headers_values = NULL; s->num_headers = 0; if(r->headers_in && ap_table_elts(r->headers_in)) { -int need_content_length_header = (s->content_length == 0) ? JK_TRUE : JK_FALSE; +int need_content_length_header = (!s->is_chunked && s->content_length == 0) ? JK_TRUE : JK_FALSE; array_header *t = ap_table_elts(r->headers_in); if(t && t->nelts) { int i;
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/xml XmlMapper.java
remm01/09/08 09:42:00 Modified:catalina/src/share/org/apache/catalina/util/xml XmlMapper.java Log: - Raise the max number of allowed rules in the XML mapper. Revision ChangesPath 1.9 +2 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/xml/XmlMapper.java Index: XmlMapper.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/xml/XmlMapper.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- XmlMapper.java2001/07/22 20:25:15 1.8 +++ XmlMapper.java2001/09/08 16:42:00 1.9 @@ -328,8 +328,8 @@ this.action=action; } } -Rule rules[]=new Rule[256]; -Rule matching[]=new Rule[256]; +Rule rules[]=new Rule[512]; +Rule matching[]=new Rule[512]; int ruleCount=0; /**
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Catalina.java
remm01/09/08 09:40:48 Modified:catalina/src/share/org/apache/catalina/startup Catalina.java Log: - Add rules to be able to add lifecycle listeners on the top level components of the pipeline through server.xml. Revision ChangesPath 1.31 +28 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java Index: Catalina.java === RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -r1.30 -r1.31 --- Catalina.java 2001/08/27 19:10:25 1.30 +++ Catalina.java 2001/09/08 16:40:48 1.31 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.30 2001/08/27 19:10:25 craigmcc Exp $ - * $Revision: 1.30 $ - * $Date: 2001/08/27 19:10:25 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.31 2001/09/08 16:40:48 remm Exp $ + * $Revision: 1.31 $ + * $Date: 2001/09/08 16:40:48 $ * * * @@ -98,7 +98,7 @@ * * * @author Craig R. McClanahan - * @version $Revision: 1.30 $ $Date: 2001/08/27 19:10:25 $ + * @version $Revision: 1.31 $ $Date: 2001/09/08 16:40:48 $ */ public class Catalina { @@ -290,12 +290,28 @@ mapper.addRule("Server", mapper.addChild ("setServer", "org.apache.catalina.Server")); +mapper.addRule("Server/Listener", mapper.objectCreate + (null, "className")); +mapper.addRule("Server/Listener", + mapper.setProperties()); +mapper.addRule("Server/Listener", mapper.addChild + ("addLifecycleListener", +"org.apache.catalina.LifecycleListener")); + mapper.addRule("Server/Service", mapper.objectCreate ("org.apache.catalina.core.StandardService", "className")); mapper.addRule("Server/Service", mapper.setProperties()); mapper.addRule("Server/Service", mapper.addChild ("addService", "org.apache.catalina.Service")); +mapper.addRule("Server/Service/Listener", mapper.objectCreate + (null, "className")); +mapper.addRule("Server/Service/Listener", + mapper.setProperties()); +mapper.addRule("Server/Service/Listener", mapper.addChild + ("addLifecycleListener", +"org.apache.catalina.LifecycleListener")); + mapper.addRule("Server/Service/Connector", mapper.objectCreate ("org.apache.catalina.connector.http.HttpConnector", "className")); @@ -332,6 +348,14 @@ new SetParentClassLoaderAction(parentClassLoader)); mapper.addRule("Server/Service/Engine", mapper.addChild ("setContainer", "org.apache.catalina.Container")); + +mapper.addRule("Server/Service/Engine/Listener", mapper.objectCreate + (null, "className")); +mapper.addRule("Server/Service/Engine/Listener", + mapper.setProperties()); +mapper.addRule("Server/Service/Engine/Listener", mapper.addChild + ("addLifecycleListener", +"org.apache.catalina.LifecycleListener")); createStartMapperContext("Server/Service/Engine/Context", mapper); createStartMapperDefaultContext(