svn commit: r1348357 - in /tomcat/trunk: BUILDING.txt build.xml

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 11:11:18 2012
New Revision: 1348357

URL: http://svn.apache.org/viewvc?rev=1348357&view=rev
Log:
Add dependencies and description to "validate" target in build.xml, so that it 
can be run separately.
Improve documentation for running with Checkstyle.
Add documentation for ends of lines check ("validate-eoln").

Modified:
tomcat/trunk/BUILDING.txt
tomcat/trunk/build.xml

Modified: tomcat/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/BUILDING.txt?rev=1348357&r1=1348356&r2=1348357&view=diff
==
--- tomcat/trunk/BUILDING.txt (original)
+++ tomcat/trunk/BUILDING.txt Sat Jun  9 11:11:18 2012
@@ -223,24 +223,12 @@ The output of this command will be found
 ant release
 
 
-(7) Enabling Checkstyle
+(7) Tests
 
-Tomcat comes with a Checkstyle configuration that tests its source code
-for certain conventions, like presence of the license header.
-
-To enable Checkstyle checks during Tomcat build, add the following property
-to build.properties file:
-
-execute.validate=true
-
-* NOTE: Checkstyle is licensed under LGPL. Using Checkstyle during Tomcat
-  build is optional and is off by default.
-
-
-(8) Running the tests
+(7.1) Running Tomcat tests
 
-The tests are not run when a release is built. There is separate command
-for running the tests.
+Tomcat includes a number of junit tests. The tests are not run when a
+release is built. There is separate command to run them.
 
 To run the testsuite use the following command:
 
@@ -256,8 +244,6 @@ directory:
 output/build/logs
 
 
-(8.1) Testing with APR connector
-
 By default the testsuite is run three times to test 3 different
 implementations of Tomcat connectors: BIO, NIO and APR. (If you are not
 familiar with Tomcat connectors, see config/http.html in documentation for
@@ -283,7 +269,7 @@ tcnative-1.dll file into ${tomcat.source
 into the above directory when the build runs.
 
 
-(8.2) Running a single test class
+(7.2) Running a single test
 
 It is possible to run a single JUnit test class by adding the "test.entry"
 property to the build.properties file. The property specifies the name of
@@ -294,7 +280,7 @@ For example:
 test.entry=org.apache.catalina.util.TestServerInfo
 
 
-(8.3) Other options
+(7.3) Other configuration options
 
  1. It is possible to enable generation of access log file when the tests
  are run. This is off by default and can be enabled by the following
@@ -320,3 +306,52 @@ For example:
  files:
 
 junit.formatter.usefile=false
+
+
+(8) Source code checks
+
+(8.1) Checkstyle
+
+* NOTE: Checkstyle is licensed under LGPL. Using Checkstyle during Tomcat
+  build is optional and is off by default.
+
+Tomcat comes with a Checkstyle configuration that tests its source code
+for certain conventions, like presence of the license header.
+
+To enable Checkstyle, add the following property to build.properties file:
+
+execute.validate=true
+
+Once Checkstyle is enabled, the check will be performed automatically
+during the build. The check is run before compilation of the source code.
+
+It is possible to run the check separately. The command is:
+
+cd ${tomcat.source}
+ant validate
+
+To speed-up repeated runs of this check, a cache is configured. The cache
+is located in the following directory:
+
+output/res/checkstyle
+
+
+(8.2) End-of-line conventions check
+
+You usually would not need to run this check. You can skip this section.
+
+Apache Tomcat project has convention that all of its textual source files,
+stored in Subversion repository, are marked with Subversion property
+"svn:eol-style" with value of "native". This convention makes the editing
+of source code on different platforms easier.
+
+This test is used by developers to check that the source code adheres to
+this convention. It verifies that the ends of lines in textual files are
+appropriate for the operating system where it is run. The idea is to run
+this check regularly on two different platforms and notify developers when
+an inconsistency is detected.
+
+The command to run this test is:
+
+cd ${tomcat.source}
+ant validate-eoln

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1348357&r1=1348356&r2=1348357&view=diff
==
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sat Jun  9 11:11:18 2012
@@ -449,7 +449,9 @@
 
   
 
-  
+  
 
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348360 - in /tomcat/tc7.0.x/trunk: ./ BUILDING.txt build.xml webapps/docs/changelog.xml

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 11:17:55 2012
New Revision: 1348360

URL: http://svn.apache.org/viewvc?rev=1348360&view=rev
Log:
Merged revision 1348357 from tomcat/trunk:
Add dependencies and description to "validate" target in build.xml, so that it 
can be run separately.
Improve documentation for running with Checkstyle.
Add documentation for ends of lines check ("validate-eoln").

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/BUILDING.txt
tomcat/tc7.0.x/trunk/build.xml
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1348357

Modified: tomcat/tc7.0.x/trunk/BUILDING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/BUILDING.txt?rev=1348360&r1=1348359&r2=1348360&view=diff
==
--- tomcat/tc7.0.x/trunk/BUILDING.txt (original)
+++ tomcat/tc7.0.x/trunk/BUILDING.txt Sat Jun  9 11:17:55 2012
@@ -223,24 +223,12 @@ The output of this command will be found
 ant release
 
 
-(7) Enabling Checkstyle
+(7) Tests
 
-Tomcat comes with a Checkstyle configuration that tests its source code
-for certain conventions, like presence of the license header.
-
-To enable Checkstyle checks during Tomcat build, add the following property
-to build.properties file:
-
-execute.validate=true
-
-* NOTE: Checkstyle is licensed under LGPL. Using Checkstyle during Tomcat
-  build is optional and is off by default.
-
-
-(8) Running the tests
+(7.1) Running Tomcat tests
 
-The tests are not run when a release is built. There is separate command
-for running the tests.
+Tomcat includes a number of junit tests. The tests are not run when a
+release is built. There is separate command to run them.
 
 To run the testsuite use the following command:
 
@@ -256,8 +244,6 @@ directory:
 output/build/logs
 
 
-(8.1) Testing with APR connector
-
 By default the testsuite is run three times to test 3 different
 implementations of Tomcat connectors: BIO, NIO and APR. (If you are not
 familiar with Tomcat connectors, see config/http.html in documentation for
@@ -283,7 +269,7 @@ tcnative-1.dll file into ${tomcat.source
 into the above directory when the build runs.
 
 
-(8.2) Running a single test class
+(7.2) Running a single test
 
 It is possible to run a single JUnit test class by adding the "test.entry"
 property to the build.properties file. The property specifies the name of
@@ -294,7 +280,7 @@ For example:
 test.entry=org.apache.catalina.util.TestServerInfo
 
 
-(8.3) Other options
+(7.3) Other configuration options
 
  1. It is possible to enable generation of access log file when the tests
  are run. This is off by default and can be enabled by the following
@@ -320,3 +306,52 @@ For example:
  files:
 
 junit.formatter.usefile=false
+
+
+(8) Source code checks
+
+(8.1) Checkstyle
+
+* NOTE: Checkstyle is licensed under LGPL. Using Checkstyle during Tomcat
+  build is optional and is off by default.
+
+Tomcat comes with a Checkstyle configuration that tests its source code
+for certain conventions, like presence of the license header.
+
+To enable Checkstyle, add the following property to build.properties file:
+
+execute.validate=true
+
+Once Checkstyle is enabled, the check will be performed automatically
+during the build. The check is run before compilation of the source code.
+
+It is possible to run the check separately. The command is:
+
+cd ${tomcat.source}
+ant validate
+
+To speed-up repeated runs of this check, a cache is configured. The cache
+is located in the following directory:
+
+output/res/checkstyle
+
+
+(8.2) End-of-line conventions check
+
+You usually would not need to run this check. You can skip this section.
+
+Apache Tomcat project has convention that all of its textual source files,
+stored in Subversion repository, are marked with Subversion property
+"svn:eol-style" with value of "native". This convention makes the editing
+of source code on different platforms easier.
+
+This test is used by developers to check that the source code adheres to
+this convention. It verifies that the ends of lines in textual files are
+appropriate for the operating system where it is run. The idea is to run
+this check regularly on two different platforms and notify developers when
+an inconsistency is detected.
+
+The command to run this test is:
+
+cd ${tomcat.source}
+ant validate-eoln

Modified: tomcat/tc7.0.x/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/build.xml?rev=1348360&r1=1348359&r2=1348360&view=diff
==
--- tomcat/tc7.0.x/trunk/build.xml (original)
+++ tomcat/tc7.0.x/trunk/build.xml Sat Jun  9 11:17:55 2012
@@ -438,7 +438,9 @@
 
   
 
-  
+  
 
 
 

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.x

svn commit: r1348398 - /tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 13:11:57 2012
New Revision: 1348398

URL: http://svn.apache.org/viewvc?rev=1348398&view=rev
Log:
Review of r1345026, comparing it with proposed patch for BZ 52955:
Add final modifiers to improve thread safety

Modified:
tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java

Modified: tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1348398&r1=1348397&r2=1348398&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java Sat Jun  9 
13:11:57 2012
@@ -1601,9 +1601,9 @@ public abstract class ContainerBase exte
 }
 
 private static class StartStopThreadFactory implements ThreadFactory {
-private ThreadGroup group;
-private AtomicInteger threadNumber = new AtomicInteger(1);
-private String namePrefix;
+private final ThreadGroup group;
+private final AtomicInteger threadNumber = new AtomicInteger(1);
+private final String namePrefix;
 
 public StartStopThreadFactory(String namePrefix) {
 SecurityManager s = System.getSecurityManager();



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348408 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/ContainerBase.java webapps/docs/changelog.xml

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 13:31:02 2012
New Revision: 1348408

URL: http://svn.apache.org/viewvc?rev=1348408&view=rev
Log:
Merged revision 1348398 from tomcat/trunk:
Review of r1345026, comparing it with proposed patch for BZ 52955:
Add final modifiers to improve thread safety
Add BZ 52955 to changelog - it has been implemented in r1345026.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1348398

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java?rev=1348408&r1=1348407&r2=1348408&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/ContainerBase.java Sat 
Jun  9 13:31:02 2012
@@ -1589,9 +1589,9 @@ public abstract class ContainerBase exte
 }
 
 private static class StartStopThreadFactory implements ThreadFactory {
-private ThreadGroup group;
-private AtomicInteger threadNumber = new AtomicInteger(1);
-private String namePrefix;
+private final ThreadGroup group;
+private final AtomicInteger threadNumber = new AtomicInteger(1);
+private final String namePrefix;
 
 public StartStopThreadFactory(String namePrefix) {
 SecurityManager s = System.getSecurityManager();

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1348408&r1=1348407&r2=1348408&view=diff
==
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat Jun  9 13:31:02 2012
@@ -60,6 +60,11 @@
 52055: An additional fix to ensure that the
 ChunkedInputFilter is correctly recycled. (markt)
   
+  
+52955: Implement custom thread factory for container
+start-stop thread pool. It allows to use daemon threads and give
+them more distinct names. (kfujino)
+  
   
 53008: Additional test cases for BASIC authentication and
 RFC2617 compliance. Patch provided by Brian Burch. (markt)



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 52955] Add a ThreadFactory implementation to the ExecutorService used to deploy applications

2012-06-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=52955

Konstantin Kolinko  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #1 from Konstantin Kolinko  ---
This feature has been independently implemented by Keiichi Fujino when fixing
bug 53342 in r1345026 and will be in 7.0.28.

The thread names are container.getName() + "-startStop-" + number.
E.g. "localhost-startStop-1".

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348425 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 15:15:54 2012
New Revision: 1348425

URL: http://svn.apache.org/viewvc?rev=1348425&view=rev
Log:
Rephrase instructions for installing Tomcat.
Improve description of environment variables. Mention CATALINA_OPTS.

Modified:
tomcat/trunk/RUNNING.txt

Modified: tomcat/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/RUNNING.txt?rev=1348425&r1=1348424&r2=1348425&view=diff
==
--- tomcat/trunk/RUNNING.txt (original)
+++ tomcat/trunk/RUNNING.txt Sat Jun  9 15:15:54 2012
@@ -28,7 +28,7 @@ Environment (JRE) version 6.0 or later.
 Running With JRE 6.0 Or Later
 =
 
-(1) Download and Install the Java SE Runtime Environment (JRE)
+(1) Download and Install Java SE Runtime Environment (JRE)
 
 (1.1) Download the Java SE Runtime Environment (JRE),
   release version 6.0 or later, from
@@ -37,23 +37,20 @@ Running With JRE 6.0 Or Later
 (1.2) Install the JRE according to the instructions included with the
   release.
 
-  You may also use the full JDK rather than just the JRE. In this
-  case set you have to configure your environment variables
-  differently - see below.
+  You may also use the full JDK rather than just the JRE.
 
 
-(2) Download and Install the Tomcat Binary Distribution
+(2) Download and Install Apache Tomcat
 
 (2.1) Download a binary distribution of Tomcat from:
 
   http://tomcat.apache.org/
 
-(2.2) Unpack the binary distribution into a convenient location so that the
-  distribution resides in its own directory (conventionally named
-  "apache-tomcat-[version]").
+(2.2) Unpack the binary distribution so that it resides in its own
+  directory (conventionally named "apache-tomcat-[version]").
 
   For the purposes of the remainder of this document, the name
-  "CATALINA_HOME" is used to refer to the full pathname of the release
+  "CATALINA_HOME" is used to refer to the full pathname of that
   directory.
 
 NOTE:  As an alternative to downloading a binary distribution, you can
@@ -65,48 +62,72 @@ create your own from the Tomcat source c
 
   b)  Do a simple build and use the "output/build" directory as
   "CATALINA_HOME".  Be warned that there are some differences between
-  contents of "output/build" and the official "release" distributive.
+  contents of "output/build" directory and full "release" distributive.
 
 
 (3) Configure Environment Variables
 
-Tomcat itself is a Java application and does not use environment variables,
-but the startup scripts use them to prepare the command that starts Tomcat.
-The full list of supported environment variables is provided as a comment
-at the top of catalina.bat (Windows) and catalina.sh (Unix) files.
-
-(3.1) CATALINA_HOME and CATALINA_BASE
-
-The CATALINA_HOME and CATALINA_BASE environment variables are used to
-specify location of Tomcat itself and of its active configuration
-respectively.
+Tomcat itself is a Java application and does not use environment variables.
+The variables are used by Tomcat startup scripts. The scripts use the
+variables to prepare the command that starts Tomcat.
+
+(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)
+
+CATALINA_HOME and CATALINA_BASE environment variables are used to
+specify location of Apache Tomcat itself and location of its active
+configuration, respectively.
 
-The CATALINA_HOME environment variable should be set as defined in (2.2)
-above. The startup scripts have some logic to set this variable
+CATALINA_HOME environment variable should be set as defined in (2.2)
+above. Tomcat startup scripts have some logic to set this variable
 automatically if it is absent (based on the location of the script in
 Unixes and on the current directory in Windows), but it might be not
 perfect.
 
-The CATALINA_BASE environment variable is optional and is further described
-in "Multiple Tomcat Instances" section below. If it is not set it defaults
+CATALINA_BASE environment variable is optional and is further described
+in "Multiple Tomcat Instances" section below. If it is absent, it defaults
 to be equal to CATALINA_HOME.
 
-(3.2) JRE_HOME and other variables
+(3.2) Set JRE_HOME or JAVA_HOME (required)
 
-The third and the last environment variable that is needed to start Tomcat
-specifies location of JRE or JDK that should be used to start Tomcat.
+JRE_HOME variable is used to specify location of a JRE or JDK that is used
+to start Tomcat.
 
-There are two different names of this variable, depending on whether JRE or
-JDK is used. Use the JRE_HOME variable to specify location of a JRE and
-JAVA_HOME variable to specify location of a JDK.
-
-All variables except CATALINA_HOME and CATALINA_BASE can be configured in a
-setenv.bat (Windows) or setenv.sh (Unix) file. The setenv file can be either
-in CATALINA_BASE/bin or in CATALINA_HOME/bin. If both are present, only the
-one in CATAL

svn commit: r1348426 - in /tomcat/tc7.0.x/trunk: ./ RUNNING.txt

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 15:19:57 2012
New Revision: 1348426

URL: http://svn.apache.org/viewvc?rev=1348426&view=rev
Log:
Merged revision 1348425 from tomcat/trunk:
Rephrase instructions for installing Tomcat.
Improve description of environment variables. Mention CATALINA_OPTS.

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/RUNNING.txt

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1348425

Modified: tomcat/tc7.0.x/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/RUNNING.txt?rev=1348426&r1=1348425&r2=1348426&view=diff
==
--- tomcat/tc7.0.x/trunk/RUNNING.txt (original)
+++ tomcat/tc7.0.x/trunk/RUNNING.txt Sat Jun  9 15:19:57 2012
@@ -28,7 +28,7 @@ Environment (JRE) version 6.0 or later.
 Running With JRE 6.0 Or Later
 =
 
-(1) Download and Install the Java SE Runtime Environment (JRE)
+(1) Download and Install Java SE Runtime Environment (JRE)
 
 (1.1) Download the Java SE Runtime Environment (JRE),
   release version 6.0 or later, from
@@ -37,23 +37,20 @@ Running With JRE 6.0 Or Later
 (1.2) Install the JRE according to the instructions included with the
   release.
 
-  You may also use the full JDK rather than just the JRE. In this
-  case set you have to configure your environment variables
-  differently - see below.
+  You may also use the full JDK rather than just the JRE.
 
 
-(2) Download and Install the Tomcat Binary Distribution
+(2) Download and Install Apache Tomcat
 
 (2.1) Download a binary distribution of Tomcat from:
 
   http://tomcat.apache.org/
 
-(2.2) Unpack the binary distribution into a convenient location so that the
-  distribution resides in its own directory (conventionally named
-  "apache-tomcat-[version]").
+(2.2) Unpack the binary distribution so that it resides in its own
+  directory (conventionally named "apache-tomcat-[version]").
 
   For the purposes of the remainder of this document, the name
-  "CATALINA_HOME" is used to refer to the full pathname of the release
+  "CATALINA_HOME" is used to refer to the full pathname of that
   directory.
 
 NOTE:  As an alternative to downloading a binary distribution, you can
@@ -65,48 +62,72 @@ create your own from the Tomcat source c
 
   b)  Do a simple build and use the "output/build" directory as
   "CATALINA_HOME".  Be warned that there are some differences between
-  contents of "output/build" and the official "release" distributive.
+  contents of "output/build" directory and full "release" distributive.
 
 
 (3) Configure Environment Variables
 
-Tomcat itself is a Java application and does not use environment variables,
-but the startup scripts use them to prepare the command that starts Tomcat.
-The full list of supported environment variables is provided as a comment
-at the top of catalina.bat (Windows) and catalina.sh (Unix) files.
-
-(3.1) CATALINA_HOME and CATALINA_BASE
-
-The CATALINA_HOME and CATALINA_BASE environment variables are used to
-specify location of Tomcat itself and of its active configuration
-respectively.
+Tomcat itself is a Java application and does not use environment variables.
+The variables are used by Tomcat startup scripts. The scripts use the
+variables to prepare the command that starts Tomcat.
+
+(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)
+
+CATALINA_HOME and CATALINA_BASE environment variables are used to
+specify location of Apache Tomcat itself and location of its active
+configuration, respectively.
 
-The CATALINA_HOME environment variable should be set as defined in (2.2)
-above. The startup scripts have some logic to set this variable
+CATALINA_HOME environment variable should be set as defined in (2.2)
+above. Tomcat startup scripts have some logic to set this variable
 automatically if it is absent (based on the location of the script in
 Unixes and on the current directory in Windows), but it might be not
 perfect.
 
-The CATALINA_BASE environment variable is optional and is further described
-in "Multiple Tomcat Instances" section below. If it is not set it defaults
+CATALINA_BASE environment variable is optional and is further described
+in "Multiple Tomcat Instances" section below. If it is absent, it defaults
 to be equal to CATALINA_HOME.
 
-(3.2) JRE_HOME and other variables
+(3.2) Set JRE_HOME or JAVA_HOME (required)
 
-The third and the last environment variable that is needed to start Tomcat
-specifies location of JRE or JDK that should be used to start Tomcat.
+JRE_HOME variable is used to specify location of a JRE or JDK that is used
+to start Tomcat.
 
-There are two different names of this variable, depending on whether JRE or
-JDK is used. Use the JRE_HOME variable to specify location of a JRE and
-JAVA_HOME variable to s

svn commit: r1348428 - in /tomcat/tc6.0.x/trunk: ./ RUNNING.txt

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 15:29:32 2012
New Revision: 1348428

URL: http://svn.apache.org/viewvc?rev=1348428&view=rev
Log:
CTR: docs
Merged revision 1348425 from tomcat/trunk:
Rephrase instructions for installing Tomcat.
Improve description of environment variables. Mention CATALINA_OPTS.

Modified:
tomcat/tc6.0.x/trunk/   (props changed)
tomcat/tc6.0.x/trunk/RUNNING.txt

Propchange: tomcat/tc6.0.x/trunk/
--
  Merged /tomcat/trunk:r1348425

Modified: tomcat/tc6.0.x/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/RUNNING.txt?rev=1348428&r1=1348427&r2=1348428&view=diff
==
--- tomcat/tc6.0.x/trunk/RUNNING.txt (original)
+++ tomcat/tc6.0.x/trunk/RUNNING.txt Sat Jun  9 15:29:32 2012
@@ -21,41 +21,36 @@ $Id$
 Running The Apache Tomcat 6.0 Servlet/JSP Container
 ===
 
-Apache Tomcat 6.0 requires the Java 2 Standard Edition Runtime
+Apache Tomcat 6.0 requires the Java Standard Edition Runtime
 Environment (JRE) version 5.0 or later.
 
 =
 Running With JRE 5.0 Or Later
 =
 
-(1) Download and Install the J2SE Runtime Environment (JRE)
+(1) Download and Install Java SE Runtime Environment (JRE)
 
-(1.1) Download the Java 2 Standard Edition Runtime Environment (JRE),
-  release version 5.0 or later, from http://java.sun.com/j2se.
+(1.1) Download the Java Standard Edition Runtime Environment (JRE),
+  release version 5.0 or later, from
+  http://www.oracle.com/technetwork/java/javase/downloads/index.html
 
 (1.2) Install the JRE according to the instructions included with the
   release.
-(1.3) Set an environment variable named JRE_HOME to the pathname of
-  the directory into which you installed the JRE, e.g. c:\jre5.0
-  or /usr/local/java/jre5.0.
 
-  You may also use the full JDK rather than just the JRE. In this
-  case set you have to configure your environment variables
-  differently - see below.
+  You may also use the full JDK rather than just the JRE.
 
 
-(2) Download and Install the Tomcat Binary Distribution
+(2) Download and Install Apache Tomcat
 
 (2.1) Download a binary distribution of Tomcat from:
 
   http://tomcat.apache.org/
 
-(2.2) Unpack the binary distribution into a convenient location so that the
-  distribution resides in its own directory (conventionally named
-  "apache-tomcat-[version]").
+(2.2) Unpack the binary distribution so that it resides in its own
+  directory (conventionally named "apache-tomcat-[version]").
 
   For the purposes of the remainder of this document, the name
-  "CATALINA_HOME" is used to refer to the full pathname of the release
+  "CATALINA_HOME" is used to refer to the full pathname of that
   directory.
 
 NOTE:  As an alternative to downloading a binary distribution, you can
@@ -67,48 +62,72 @@ create your own from the Tomcat source c
 
   b)  Do a simple build and use the "output/build" directory as
   "CATALINA_HOME".  Be warned that there are some differences between
-  contents of "output/build" and the official "release" distributive.
+  contents of "output/build" directory and full "release" distributive.
 
 
 (3) Configure Environment Variables
 
-Tomcat itself is a Java application and does not use environment variables,
-but the startup scripts use them to prepare the command that starts Tomcat.
-The full list of supported environment variables is provided as a comment
-at the top of catalina.bat (Windows) and catalina.sh (Unix) files.
-
-(3.1) CATALINA_HOME and CATALINA_BASE
-
-The CATALINA_HOME and CATALINA_BASE environment variables are used to
-specify location of Tomcat itself and of its active configuration
-respectively.
+Tomcat itself is a Java application and does not use environment variables.
+The variables are used by Tomcat startup scripts. The scripts use the
+variables to prepare the command that starts Tomcat.
+
+(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)
+
+CATALINA_HOME and CATALINA_BASE environment variables are used to
+specify location of Apache Tomcat itself and location of its active
+configuration, respectively.
 
-The CATALINA_HOME environment variable should be set as defined in (2.2)
-above. The startup scripts have some logic to set this variable
+CATALINA_HOME environment variable should be set as defined in (2.2)
+above. Tomcat startup scripts have some logic to set this variable
 automatically if it is absent (based on the location of the script in
 Unixes and on the current directory in Windows), but it might be not
 perfect.
 
-The CATALINA_BASE environment variable is optional and is further described
-in "Multiple Tomcat Instances" section below. If it is not set it defaults
+CATALINA_BASE environm

svn commit: r1348461 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 17:16:45 2012
New Revision: 1348461

URL: http://svn.apache.org/viewvc?rev=1348461&view=rev
Log:
Further improvement of RUNNING.txt.
Mention CATALINA_PID, as it is another frequently used environment variable.

Modified:
tomcat/trunk/RUNNING.txt

Modified: tomcat/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/RUNNING.txt?rev=1348461&r1=1348460&r2=1348461&view=diff
==
--- tomcat/trunk/RUNNING.txt (original)
+++ tomcat/trunk/RUNNING.txt Sat Jun  9 17:16:45 2012
@@ -114,6 +114,15 @@ See Java documentation for options that 
 See System Properties page in Configuration Reference for system properties
 that are specific to Tomcat.
 
+Other frequently used variable is CATALINA_PID (on *nix platforms only). It
+specifies location of the file where process id of forked Tomcat java
+process will be written. This setting is optional. It will enable the
+following features:
+
+ - better protection against duplicate start attempts and
+ - allow forceful termination of Tomcat process when it does not react to
+ the standard shutdown command.
+
 (3.4) setenv script (optional)
 
 Except CATALINA_HOME and CATALINA_BASE, all other environment variables can
@@ -126,8 +135,8 @@ has to be readable.
 By default setenv script file is absent. If setenv script is present both
 in CATALINA_BASE and in CATALINA_HOME, the one in CATALINA_BASE is used.
 
-For example, to configure JRE_HOME variable you can create the following
-script file:
+For example, to configure JRE_HOME and CATALINA_PID variables you can
+create the following script file:
 
 On Windows, %CATALINA_BASE%\bin\setenv.bat:
 
@@ -137,8 +146,9 @@ On Windows, %CATALINA_BASE%\bin\setenv.b
 On Unix, $CATALINA_BASE/bin/setenv.sh:
 
   JRE_HOME=/usr/java/latest
+  CATALINA_PID="$CATALINA_BASE/tomcat.pid"
 
-You cannot configure CATALINA_HOME or CATALINA_BASE variable in setenv
+You cannot configure CATALINA_HOME and CATALINA_BASE variables in setenv
 script, because they are used to find that file.
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1348425 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread Mark Thomas


kkoli...@apache.org wrote:

>Author: kkolinko
>Date: Sat Jun  9 15:15:54 2012
>New Revision: 1348425
>
>URL: http://svn.apache.org/viewvc?rev=1348425&view=rev

>-(1) Download and Install the Java SE Runtime Environment (JRE)
>+(1) Download and Install Java SE Runtime Environment (JRE)

That change is worse grammatically.

Reinstating "the" would be good. Using "a" rather than "the" would be better 
since there is more than one JRE.

Using "a JRE" rather than "the JRE" is probably a better choice for most of the 
file. The same goes for JDK.

>   b)  Do a simple build and use the "output/build" directory as
>"CATALINA_HOME".  Be warned that there are some differences between
>-  contents of "output/build" and the official "release"
>distributive.
>+  contents of "output/build" directory and full "release"
>distributive.

s/distributive/distribution/

>+Tomcat itself is a Java application and does not use environment
>variables.

"itself" is unnecessary here.

>+JRE_HOME variable is used to specify location of a JRE or JDK that is
>used
>+to start Tomcat.

That is not consistent with what follows...

>+JAVA_HOME variable is used to specify location of a JDK. It is used
>instead
>+of JRE_HOME.

>+(3.3) Other variables (optional)
>+
>+There exist other environment variables, besides the four described
>above.
>+See the comment at the top of catalina.bat or catalina.sh scripts for
>+the list and description of them.
>+
>+One frequently used variable is CATALINA_OPTS. It allows to specify
>+additional options for java command that starts Tomcat.

Compare to JAVA_OPTS here maybe?

>+
>+See Java documentation for options that affect Java Runtime
>Environment.

See the Java ...

>+See System Properties page in Configuration Reference for system
>properties

Need more "the"s

See the System... in the Configuration ... for the system ...

>+By default setenv script file is absent. If setenv script is present

...default the setenv ... If the setenv ...


Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348490 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread kkolinko
Author: kkolinko
Date: Sat Jun  9 19:51:23 2012
New Revision: 1348490

URL: http://svn.apache.org/viewvc?rev=1348490&view=rev
Log:
Further improvement of RUNNING.txt.
Address Mark's review comments.
Document Apache Tomcat Native and Apache Commons Daemon.

Modified:
tomcat/trunk/RUNNING.txt

Modified: tomcat/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/RUNNING.txt?rev=1348490&r1=1348489&r2=1348490&view=diff
==
--- tomcat/trunk/RUNNING.txt (original)
+++ tomcat/trunk/RUNNING.txt Sat Jun  9 19:51:23 2012
@@ -28,16 +28,17 @@ Environment (JRE) version 6.0 or later.
 Running With JRE 6.0 Or Later
 =
 
-(1) Download and Install Java SE Runtime Environment (JRE)
+(1) Download and Install a Java SE Runtime Environment (JRE)
 
-(1.1) Download the Java SE Runtime Environment (JRE),
+(1.1) Download a Java SE Runtime Environment (JRE),
   release version 6.0 or later, from
   http://www.oracle.com/technetwork/java/javase/downloads/index.html
 
 (1.2) Install the JRE according to the instructions included with the
   release.
 
-  You may also use the full JDK rather than just the JRE.
+  You may also use a full Java Development Kit (JDK) rather than just
+  a JRE.
 
 
 (2) Download and Install Apache Tomcat
@@ -62,14 +63,14 @@ create your own from the Tomcat source c
 
   b)  Do a simple build and use the "output/build" directory as
   "CATALINA_HOME".  Be warned that there are some differences between
-  contents of "output/build" directory and full "release" distributive.
+  contents of "output/build" directory and full "release" distribution.
 
 
 (3) Configure Environment Variables
 
-Tomcat itself is a Java application and does not use environment variables.
-The variables are used by Tomcat startup scripts. The scripts use the
-variables to prepare the command that starts Tomcat.
+Tomcat is a Java application and does not use environment variables. The
+variables are used by Tomcat startup scripts. The scripts use the variables
+to prepare the command that starts Tomcat.
 
 (3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)
 
@@ -87,10 +88,11 @@ CATALINA_BASE environment variable is op
 in "Multiple Tomcat Instances" section below. If it is absent, it defaults
 to be equal to CATALINA_HOME.
 
+
 (3.2) Set JRE_HOME or JAVA_HOME (required)
 
-JRE_HOME variable is used to specify location of a JRE or JDK that is used
-to start Tomcat.
+JRE_HOME variable is used to specify location of a JRE that is used to
+start Tomcat.
 
 JAVA_HOME variable is used to specify location of a JDK. It is used instead
 of JRE_HOME.
@@ -100,6 +102,7 @@ are not allowed when JRE_HOME is used.
 
 If both JRE_HOME and JAVA_HOME are specified, JRE_HOME is used.
 
+
 (3.3) Other variables (optional)
 
 There exist other environment variables, besides the four described above.
@@ -109,13 +112,22 @@ the list and description of them.
 One frequently used variable is CATALINA_OPTS. It allows to specify
 additional options for java command that starts Tomcat.
 
-See Java documentation for options that affect Java Runtime Environment.
+See the Java documentation for the options that affect Java Runtime
+Environment.
 
-See System Properties page in Configuration Reference for system properties
-that are specific to Tomcat.
+See the "System Properties" page in the Tomcat Configuration Reference for
+the system properties that are specific to Tomcat.
+
+A similar variable is JAVA_OPTS. It is used less frequently. It allows to
+specify options that are used both to start and to stop Tomcat and
+for other commands.
+
+Do not use JAVA_OPTS to specify memory limits. You do not need much memory
+for a small process that is used to stop Tomcat. Those settings belong to
+CATALINA_OPTS.
 
 Other frequently used variable is CATALINA_PID (on *nix platforms only). It
-specifies location of the file where process id of forked Tomcat java
+specifies location of the file where process id of the forked Tomcat java
 process will be written. This setting is optional. It will enable the
 following features:
 
@@ -123,6 +135,7 @@ following features:
  - allow forceful termination of Tomcat process when it does not react to
  the standard shutdown command.
 
+
 (3.4) setenv script (optional)
 
 Except CATALINA_HOME and CATALINA_BASE, all other environment variables can
@@ -132,8 +145,9 @@ The script is named setenv.bat (Windows)
 placed either into CATALINA_BASE/bin or into CATALINA_HOME/bin. The file
 has to be readable.
 
-By default setenv script file is absent. If setenv script is present both
-in CATALINA_BASE and in CATALINA_HOME, the one in CATALINA_BASE is used.
+By default the setenv script file is absent. If the setenv script is
+present both in CATALINA_BASE and in CATALINA_HOME, the one in
+CATALINA_BASE is used.
 
 For example, to configure JRE_HOME and CATALINA_PID variables you ca

Re: svn commit: r1348425 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread Konstantin Kolinko
2012/6/9 Mark Thomas :
>
>
> kkoli...@apache.org wrote:
>
>>Author: kkolinko
>>Date: Sat Jun  9 15:15:54 2012
>>New Revision: 1348425
>>
>>URL: http://svn.apache.org/viewvc?rev=1348425&view=rev
>
>>-(1) Download and Install the Java SE Runtime Environment (JRE)
>>+(1) Download and Install Java SE Runtime Environment (JRE)
>
> That change is worse grammatically.
>

Thank you for the review.

I tried to incorporate your feedback into last update of the file in
trunk (r1348490).

If you can review it (or any other native English speaker there?) it
would be nice. I would wait a while (~ 10-12 hours) before porting the
changes into Tomcat 7 and 6.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: svn commit: r1348425 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread Mark Thomas
On 09/06/2012 20:57, Konstantin Kolinko wrote:
> 2012/6/9 Mark Thomas :
>>
>>
>> kkoli...@apache.org wrote:
>>
>>> Author: kkolinko
>>> Date: Sat Jun  9 15:15:54 2012
>>> New Revision: 1348425
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1348425&view=rev
>>
>>> -(1) Download and Install the Java SE Runtime Environment (JRE)
>>> +(1) Download and Install Java SE Runtime Environment (JRE)
>>
>> That change is worse grammatically.
>>
> 
> Thank you for the review.
> 
> I tried to incorporate your feedback into last update of the file in
> trunk (r1348490).
> 
> If you can review it (or any other native English speaker there?) it
> would be nice. I would wait a while (~ 10-12 hours) before porting the
> changes into Tomcat 7 and 6.

I'll read through it now.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348495 - /tomcat/trunk/RUNNING.txt

2012-06-09 Thread markt
Author: markt
Date: Sat Jun  9 20:15:25 2012
New Revision: 1348495

URL: http://svn.apache.org/viewvc?rev=1348495&view=rev
Log:
Review by native English speaker as requested.
Mostly a/the changes and inserts
Re-worded a few sentences that didn't scan cleanly
Removed the section on Win 95/98/ME since they are all well past end of life.

Modified:
tomcat/trunk/RUNNING.txt

Modified: tomcat/trunk/RUNNING.txt
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/RUNNING.txt?rev=1348495&r1=1348494&r2=1348495&view=diff
==
--- tomcat/trunk/RUNNING.txt (original)
+++ tomcat/trunk/RUNNING.txt Sat Jun  9 20:15:25 2012
@@ -21,7 +21,7 @@ $Id$
 Running The Apache Tomcat @VERSION_MAJOR_MINOR@ Servlet/JSP 
Container
 ===
 
-Apache Tomcat @VERSION_MAJOR_MINOR@ requires the Java Standard Edition Runtime
+Apache Tomcat @VERSION_MAJOR_MINOR@ requires a Java Standard Edition Runtime
 Environment (JRE) version 6.0 or later.
 
 =
@@ -58,43 +58,44 @@ NOTE:  As an alternative to downloading 
 create your own from the Tomcat source code, as described in
 "BUILDING.txt".  You can either
 
-  a)  Do the full "release" build and find the created distributive in the
+  a)  Do the full "release" build and find the created distribution in the
   "output/release" directory and then proceed with unpacking as above, or
 
   b)  Do a simple build and use the "output/build" directory as
-  "CATALINA_HOME".  Be warned that there are some differences between
-  contents of "output/build" directory and full "release" distribution.
+  "CATALINA_HOME".  Be warned that there are some differences between the
+  contents of the "output/build" directory and a full "release"
+  distribution.
 
 
 (3) Configure Environment Variables
 
 Tomcat is a Java application and does not use environment variables. The
-variables are used by Tomcat startup scripts. The scripts use the variables
+variables are used by the Tomcat startup scripts. The scripts use the variables
 to prepare the command that starts Tomcat.
 
 (3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)
 
-CATALINA_HOME and CATALINA_BASE environment variables are used to
-specify location of Apache Tomcat itself and location of its active
+The CATALINA_HOME and CATALINA_BASE environment variables are used to
+specify the location of Apache Tomcat and the location of its active
 configuration, respectively.
 
-CATALINA_HOME environment variable should be set as defined in (2.2)
-above. Tomcat startup scripts have some logic to set this variable
+The CATALINA_HOME environment variable should be set as defined in (2.2)
+above. The Tomcat startup scripts have some logic to set this variable
 automatically if it is absent (based on the location of the script in
-Unixes and on the current directory in Windows), but it might be not
-perfect.
+Unixes and on the current directory in Windows), but this logic might not work
+in all circumstances.
 
-CATALINA_BASE environment variable is optional and is further described
-in "Multiple Tomcat Instances" section below. If it is absent, it defaults
+The CATALINA_BASE environment variable is optional and is further described
+in the "Multiple Tomcat Instances" section below. If it is absent, it defaults
 to be equal to CATALINA_HOME.
 
 
 (3.2) Set JRE_HOME or JAVA_HOME (required)
 
-JRE_HOME variable is used to specify location of a JRE that is used to
+The JRE_HOME variable is used to specify location of a JRE that is used to
 start Tomcat.
 
-JAVA_HOME variable is used to specify location of a JDK. It is used instead
+The JAVA_HOME variable is used to specify location of a JDK. It is used instead
 of JRE_HOME.
 
 Using JAVA_HOME provides access to certain additional startup options that
@@ -105,41 +106,41 @@ If both JRE_HOME and JAVA_HOME are speci
 
 (3.3) Other variables (optional)
 
-There exist other environment variables, besides the four described above.
-See the comment at the top of catalina.bat or catalina.sh scripts for
-the list and description of them.
+Other environment variables exist, besides the four described above.
+See the comments at the top of catalina.bat or catalina.sh scripts for
+the list and a description of each of them.
 
-One frequently used variable is CATALINA_OPTS. It allows to specify
-additional options for java command that starts Tomcat.
+One frequently used variable is CATALINA_OPTS. It allows specification of
+additional options for the java command that starts Tomcat.
 
-See the Java documentation for the options that affect Java Runtime
+See the Java documentation for the options that affect the Java Runtime
 Environment.
 
 See the "System Properties" page in the Tomcat Configuration Reference for
 the system properties that are specific to Tomcat.
 
-A similar variable is JAVA_OPTS. It is used less frequently. I

svn commit: r1348498 - in /tomcat/trunk/java/org/apache/catalina/realm: DataSourceRealm.java JDBCRealm.java

2012-06-09 Thread markt
Author: markt
Date: Sat Jun  9 20:30:44 2012
New Revision: 1348498

URL: http://svn.apache.org/viewvc?rev=1348498&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53047
If the Realm is configured for an authentication only all roles mode and no 
role table or column is defined, don't populate the Principal's roles

Modified:
tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java

Modified: tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java?rev=1348498&r1=1348497&r2=1348498&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/DataSourceRealm.java Sat Jun  9 
20:30:44 2012
@@ -500,6 +500,12 @@ public class DataSourceRealm extends Rea
 protected ArrayList getRoles(Connection dbConnection,
  String username) {
 
+if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
+// Using an authentication only configuration and no role store has
+// been defined so don't spend cycles looking
+return null;
+}
+
 ResultSet rs = null;
 PreparedStatement stmt = null;
 ArrayList list = null;
@@ -579,8 +585,13 @@ public class DataSourceRealm extends Rea
 
 }
 
-// -- Lifecycle Methods
 
+private boolean isRoleStoreDefined() {
+return userRoleTable != null || roleNameCol != null;
+}
+
+
+// -- Lifecycle Methods
 
 /**
  * Prepare for the beginning of active use of the public methods of this

Modified: tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=1348498&r1=1348497&r2=1348498&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java Sat Jun  9 
20:30:44 2012
@@ -596,6 +596,12 @@ public class JDBCRealm
  */
 protected ArrayList getRoles(String username) {
 
+if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
+// Using an authentication only configuration and no role store has
+// been defined so don't spend cycles looking
+return null;
+}
+
 PreparedStatement stmt = null;
 ResultSet rs = null;
 
@@ -655,8 +661,7 @@ public class JDBCRealm
 numberOfTries--;
 }
 
-return (null);
-
+return null;
 }
 
 
@@ -743,8 +748,12 @@ public class JDBCRealm
 }
 
 
-// -- Lifecycle Methods
+private boolean isRoleStoreDefined() {
+return userRoleTable != null || roleNameCol != null;
+}
+
 
+// -- Lifecycle Methods
 
 /**
  * Prepare for the beginning of active use of the public methods of this



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Need a native connector release

2012-06-09 Thread Mark Thomas
Tomcat 7.0.28 is getting close to being ready to roll the release.
However, a new native release is required since the new infinite time
out feature required by WebSocket needs native 1.2.24.

Mladen, what are the chances of you starting a native 1.2.24 release in
the next few days?

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348499 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/realm/DataSourceRealm.java java/org/apache/catalina/realm/JDBCRealm.java

2012-06-09 Thread markt
Author: markt
Date: Sat Jun  9 20:37:14 2012
New Revision: 1348499

URL: http://svn.apache.org/viewvc?rev=1348499&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53047
If the Realm is configured for an authentication only all roles mode and no 
role table or column is defined, don't populate the Principal's roles

Modified:
tomcat/tc7.0.x/trunk/   (props changed)
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java

Propchange: tomcat/tc7.0.x/trunk/
--
  Merged /tomcat/trunk:r1348498

Modified: 
tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java?rev=1348499&r1=1348498&r2=1348499&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/DataSourceRealm.java 
Sat Jun  9 20:37:14 2012
@@ -524,6 +524,12 @@ public class DataSourceRealm
 protected ArrayList getRoles(Connection dbConnection,
  String username) {
 
+if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
+// Using an authentication only configuration and no role store has
+// been defined so don't spend cycles looking
+return null;
+}
+
 ResultSet rs = null;
 PreparedStatement stmt = null;
 ArrayList list = null;
@@ -603,8 +609,13 @@ public class DataSourceRealm
 
 }
 
-// -- Lifecycle Methods
 
+private boolean isRoleStoreDefined() {
+return userRoleTable != null || roleNameCol != null;
+}
+
+
+// -- Lifecycle Methods
 
 /**
  * Prepare for the beginning of active use of the public methods of this

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java?rev=1348499&r1=1348498&r2=1348499&view=diff
==
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java 
(original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/realm/JDBCRealm.java Sat Jun  
9 20:37:14 2012
@@ -615,6 +615,12 @@ public class JDBCRealm
  */
 protected ArrayList getRoles(String username) {
 
+if (allRolesMode != AllRolesMode.STRICT_MODE && !isRoleStoreDefined()) 
{
+// Using an authentication only configuration and no role store has
+// been defined so don't spend cycles looking
+return null;
+}
+
 PreparedStatement stmt = null;
 ResultSet rs = null;
 
@@ -674,8 +680,7 @@ public class JDBCRealm
 numberOfTries--;
 }
 
-return (null);
-
+return null;
 }
 
 
@@ -762,8 +767,12 @@ public class JDBCRealm
 }
 
 
-// -- Lifecycle Methods
+private boolean isRoleStoreDefined() {
+return userRoleTable != null || roleNameCol != null;
+}
+
 
+// -- Lifecycle Methods
 
 /**
  * Prepare for the beginning of active use of the public methods of this



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1348500 - /tomcat/tc6.0.x/trunk/STATUS.txt

2012-06-09 Thread markt
Author: markt
Date: Sat Jun  9 20:38:55 2012
New Revision: 1348500

URL: http://svn.apache.org/viewvc?rev=1348500&view=rev
Log:
Proposal

Modified:
tomcat/tc6.0.x/trunk/STATUS.txt

Modified: tomcat/tc6.0.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1348500&r1=1348499&r2=1348500&view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Sat Jun  9 20:38:55 2012
@@ -218,6 +218,14 @@ PATCHES PROPOSED TO BACKPORT:
   +1: kkolinko
   -1:
 
+* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53047
+  Allow database realms configured with an all roles mode that is 
authentication
+  only to not have to define a role table
+  http://svn.apache.org/viewvc?rev=1348498&view=rev
+  +1: markt
+  -1:
+
+
 PATCHES/ISSUES THAT ARE STALLED
 
 * Backport JSP unloading patch (BZ48358).



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 53047] JDBCRealm allRolesMode="authOnly" still needs role table

2012-06-09 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=53047

--- Comment #10 from Mark Thomas  ---
In the end I opted to implement this for JDBCRealm and DatasourceRealm and
without any logging on Realm start.

The fixed has been applied to trunk and 7.0.x and will be included in 7.0.28
onwards.

The fix has been proposed for 6.0.x.

-- 
You are receiving this mail because:
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org