svn commit: r1137541 - in /tomcat/trunk: conf/catalina.properties webapps/docs/changelog.xml

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 08:06:56 2011
New Revision: 1137541

URL: http://svn.apache.org/viewvc?rev=1137541view=rev
Log:
Add the Tomcat extras JARs to the list of JARs
to skip when scanning for TLDs and web fragments.

Modified:
tomcat/trunk/conf/catalina.properties
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/conf/catalina.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/conf/catalina.properties?rev=1137541r1=1137540r2=1137541view=diff
==
--- tomcat/trunk/conf/catalina.properties (original)
+++ tomcat/trunk/conf/catalina.properties Mon Jun 20 08:06:56 2011
@@ -92,6 +92,7 @@ catalina.jar,catalina-ant.jar,catalina-h
 jasper.jar,jasper-el.jar,ecj-*.jar,\
 tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
 tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
+tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar,\
 commons-beanutils*.jar,commons-codec*.jar,commons-collections*.jar,\
 commons-dbcp*.jar,commons-digester*.jar,commons-fileupload*.jar,\
 
commons-httpclient*.jar,commons-io*.jar,commons-lang*.jar,commons-logging*.jar,\

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137541r1=1137540r2=1137541view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 08:06:56 2011
@@ -68,6 +68,10 @@
 bug49165/bug: Allow any time stamp formats supported by 
SimpleDateFormat
 in AccessLogValve. Support logging begin and/or end of request. (rjung)
   /fix
+  add
+Add the Tomcat extras JARs to the list of JARs to skip when scanning
+for TLDs and web fragments. (rjung)
+  /add
 /changelog
   /subsection
   subsection name=Coyote



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



svn commit: r1137559 - /tomcat/trunk/bin/digest.bat

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:27:30 2011
New Revision: 1137559

URL: http://svn.apache.org/viewvc?rev=1137559view=rev
Log:
Make Windows shell scripts for individual
commands consistent.

Modified:
tomcat/trunk/bin/digest.bat

Modified: tomcat/trunk/bin/digest.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/digest.bat?rev=1137559r1=1137558r2=1137559view=diff
==
--- tomcat/trunk/bin/digest.bat (original)
+++ tomcat/trunk/bin/digest.bat Mon Jun 20 09:27:30 2011
@@ -22,10 +22,13 @@ rem $Id$
 rem ---
 
 rem Guess CATALINA_HOME if not defined
+set CURRENT_DIR=%cd%
 if not %CATALINA_HOME% ==  goto gotHome
-set CATALINA_HOME=.
+set CATALINA_HOME=%CURRENT_DIR%
 if exist %CATALINA_HOME%\bin\tool-wrapper.bat goto okHome
-set CATALINA_HOME=..
+cd ..
+set CATALINA_HOME=%cd%
+cd %CURRENT_DIR%
 :gotHome
 if exist %CATALINA_HOME%\bin\tool-wrapper.bat goto okHome
 echo The CATALINA_HOME environment variable is not defined correctly



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



svn commit: r1137560 - /tomcat/trunk/bin/configtest.bat

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:27:44 2011
New Revision: 1137560

URL: http://svn.apache.org/viewvc?rev=1137560view=rev
Log:
Add missing Windows configtest script.

Added:
tomcat/trunk/bin/configtest.bat   (with props)

Added: tomcat/trunk/bin/configtest.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/configtest.bat?rev=1137560view=auto
==
--- tomcat/trunk/bin/configtest.bat (added)
+++ tomcat/trunk/bin/configtest.bat Mon Jun 20 09:27:44 2011
@@ -0,0 +1,59 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the License); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an AS IS BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+if %OS% == Windows_NT setlocal
+rem ---
+rem Configuration test script for the CATALINA Server
+rem
+rem $Id$
+rem ---
+
+rem Guess CATALINA_HOME if not defined
+set CURRENT_DIR=%cd%
+if not %CATALINA_HOME% ==  goto gotHome
+set CATALINA_HOME=%CURRENT_DIR%
+if exist %CATALINA_HOME%\bin\catalina.bat goto okHome
+cd ..
+set CATALINA_HOME=%cd%
+cd %CURRENT_DIR%
+:gotHome
+if exist %CATALINA_HOME%\bin\catalina.bat goto okHome
+echo The CATALINA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+set EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat
+
+rem Check that target executable exists
+if exist %EXECUTABLE% goto okExec
+echo Cannot find %EXECUTABLE%
+echo This file is needed to run this program
+goto end
+:okExec
+
+rem Get remaining unshifted command line arguments and save them in the
+set CMD_LINE_ARGS=
+:setArgs
+if %1== goto doneSetArgs
+set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
+shift
+goto setArgs
+:doneSetArgs
+
+call %EXECUTABLE% configtest %CMD_LINE_ARGS%
+
+:end

Propchange: tomcat/trunk/bin/configtest.bat
--
svn:eol-style = native

Propchange: tomcat/trunk/bin/configtest.bat
--
svn:executable = *

Propchange: tomcat/trunk/bin/configtest.bat
--
svn:keywords = Author Date Id Revision



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



svn commit: r1137558 - in /tomcat/trunk/bin: configtest.sh digest.sh shutdown.sh startup.sh version.sh

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:26:36 2011
New Revision: 1137558

URL: http://svn.apache.org/viewvc?rev=1137558view=rev
Log:
Make Unix shell scripts for individual
commands consistent.

Modified:
tomcat/trunk/bin/configtest.sh   (contents, props changed)
tomcat/trunk/bin/digest.sh
tomcat/trunk/bin/shutdown.sh
tomcat/trunk/bin/startup.sh
tomcat/trunk/bin/version.sh

Modified: tomcat/trunk/bin/configtest.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/configtest.sh?rev=1137558r1=1137557r2=1137558view=diff
==
--- tomcat/trunk/bin/configtest.sh (original)
+++ tomcat/trunk/bin/configtest.sh Mon Jun 20 09:26:36 2011
@@ -16,18 +16,15 @@
 # limitations under the License.
 
 # -
-# configtest for the CATALINA Server
+# Configuration Test Script for the CATALINA Server
 #
-# $Id: configtest.sh  $
+# $Id$
 # -
 
 # Better OS/400 detection: see Bugzilla 31132
 os400=false
-darwin=false
 case `uname` in
-CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
-Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink
@@ -63,4 +60,3 @@ else
 fi 
 
 exec $PRGDIR/$EXECUTABLE configtest $@
-

Propchange: tomcat/trunk/bin/configtest.sh
--
svn:keywords = Author Date Id Revision

Modified: tomcat/trunk/bin/digest.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/digest.sh?rev=1137558r1=1137557r2=1137558view=diff
==
--- tomcat/trunk/bin/digest.sh (original)
+++ tomcat/trunk/bin/digest.sh Mon Jun 20 09:26:36 2011
@@ -21,6 +21,12 @@
 # $Id$
 # -
 
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+case `uname` in
+OS400*) os400=true;;
+esac
+
 # resolve links - $0 may be a softlink
 PRG=$0
 
@@ -38,11 +44,19 @@ PRGDIR=`dirname $PRG`
 EXECUTABLE=tool-wrapper.sh
 
 # Check that target executable exists
-if [ ! -x $PRGDIR/$EXECUTABLE ]; then
-  echo Cannot find $PRGDIR/$EXECUTABLE
-  echo The file is absent or does not have execute permission
-  echo This file is needed to run this program
-  exit 1
-fi
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x $PRGDIR/$EXECUTABLE ]; then
+echo Cannot find $PRGDIR/$EXECUTABLE
+echo The file is absent or does not have execute permission
+echo This file is needed to run this program
+exit 1
+  fi
+fi 
 
 exec $PRGDIR/$EXECUTABLE -server org.apache.catalina.realm.RealmBase $@

Modified: tomcat/trunk/bin/shutdown.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/shutdown.sh?rev=1137558r1=1137557r2=1137558view=diff
==
--- tomcat/trunk/bin/shutdown.sh (original)
+++ tomcat/trunk/bin/shutdown.sh Mon Jun 20 09:26:36 2011
@@ -21,6 +21,12 @@
 # $Id$
 # -
 
+# Better OS/400 detection: see Bugzilla 31132
+os400=false
+case `uname` in
+OS400*) os400=true;;
+esac
+
 # resolve links - $0 may be a softlink
 PRG=$0
 
@@ -38,11 +44,19 @@ PRGDIR=`dirname $PRG`
 EXECUTABLE=catalina.sh
 
 # Check that target executable exists
-if [ ! -x $PRGDIR/$EXECUTABLE ]; then
-  echo Cannot find $PRGDIR/$EXECUTABLE
-  echo The file is absent or does not have execute permission
-  echo This file is needed to run this program
-  exit 1
-fi
+if $os400; then
+  # -x will Only work on the os400 if the files are: 
+  # 1. owned by the user
+  # 2. owned by the PRIMARY group of the user
+  # this will not work if the user belongs in secondary groups
+  eval
+else
+  if [ ! -x $PRGDIR/$EXECUTABLE ]; then
+echo Cannot find $PRGDIR/$EXECUTABLE
+echo The file is absent or does not have execute permission
+echo This file is needed to run this program
+exit 1
+  fi
+fi 
 
 exec $PRGDIR/$EXECUTABLE stop $@

Modified: tomcat/trunk/bin/startup.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/startup.sh?rev=1137558r1=1137557r2=1137558view=diff
==
--- tomcat/trunk/bin/startup.sh (original)
+++ tomcat/trunk/bin/startup.sh Mon Jun 20 09:26:36 2011
@@ -23,11 +23,8 @@
 
 # Better OS/400 detection: see Bugzilla 31132
 os400=false
-darwin=false
 case `uname` in
-CYGWIN*) cygwin=true;;
 OS400*) os400=true;;
-Darwin*) darwin=true;;
 esac
 
 # resolve links - $0 may be a softlink

Modified: tomcat/trunk/bin/version.sh
URL: 

svn commit: r1137565 - /tomcat/trunk/bin/setclasspath.bat

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:50:17 2011
New Revision: 1137565

URL: http://svn.apache.org/viewvc?rev=1137565view=rev
Log:
Make JRE / JDK detection on Windows work
the same way as on Unix:
- if debug is demanded, only use JAVA_HOME
  and check for a JDK there
- without debug, either use JRE_HOME
  or JAVA_HOME with precedence on JRE_HOME

Modified:
tomcat/trunk/bin/setclasspath.bat

Modified: tomcat/trunk/bin/setclasspath.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/setclasspath.bat?rev=1137565r1=1137564r2=1137565view=diff
==
--- tomcat/trunk/bin/setclasspath.bat (original)
+++ tomcat/trunk/bin/setclasspath.bat Mon Jun 20 09:50:17 2011
@@ -23,35 +23,50 @@ rem $Id$
 rem ---
 
 rem Make sure prerequisite environment variables are set
-if not %JAVA_HOME% ==  goto gotJdkHome
+
+rem In debug mode we need a real JDK (JAVA_HOME)
+if %1 == debug goto needJavaHome
+
+rem Otherwise either JRE or JDK are fine
 if not %JRE_HOME% ==  goto gotJreHome
+if not %JAVA_HOME% ==  goto gotJavaHome
 echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
 echo At least one of these environment variable is needed to run this program
 goto exit
 
-:gotJreHome
-if not exist %JRE_HOME%\bin\java.exe goto noJavaHome
-if not exist %JRE_HOME%\bin\javaw.exe goto noJavaHome
-if not %1 == debug goto okJavaHome
-echo JAVA_HOME should point to a JDK in order to run in debug mode.
-goto exit
-
-:gotJdkHome
+:needJavaHome
+rem Check if we have a usable JDK
+if %JAVA_HOME% ==  goto noJavaHome
 if not exist %JAVA_HOME%\bin\java.exe goto noJavaHome
 if not exist %JAVA_HOME%\bin\javaw.exe goto noJavaHome
 if not exist %JAVA_HOME%\bin\jdb.exe goto noJavaHome
 if not exist %JAVA_HOME%\bin\javac.exe goto noJavaHome
-if not %JRE_HOME% ==  goto okJavaHome
 set JRE_HOME=%JAVA_HOME%
-goto okJavaHome
+goto okJava
 
 :noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
+echo The JAVA_HOME environment variable is not defined correctly.
+echo It is needed to run this program in debug mode.
+echo NB: JAVA_HOME should point to a JDK not a JRE.
+goto exit
+
+:gotJavaHome
+rem No JRE given, use JAVA_HOME as JRE_HOME
+set JRE_HOME=%JAVA_HOME%
+
+:gotJreHome
+rem Check if we have a usable JRE
+if not exist %JRE_HOME%\bin\java.exe goto noJreHome
+if not exist %JRE_HOME%\bin\javaw.exe goto noJreHome
+goto okJava
+
+:noJreHome
+rem Needed at least a JRE
+echo The JRE_HOME environment variable is not defined correctly
 echo This environment variable is needed to run this program
-echo NB: JAVA_HOME should point to a JDK not a JRE
 goto exit
-:okJavaHome
 
+:okJava
 if not %BASEDIR% ==  goto gotBasedir
 echo The BASEDIR environment variable is not defined
 echo This environment variable is needed to run this program



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



svn commit: r1137567 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:52:16 2011
New Revision: 1137567

URL: http://svn.apache.org/viewvc?rev=1137567view=rev
Log:
- Clarify JRE_HOME in catalina.sh
- sort OS detection by OS name

Modified:
tomcat/trunk/bin/catalina.sh

Modified: tomcat/trunk/bin/catalina.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1137567r1=1137566r2=1137567view=diff
==
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Mon Jun 20 09:52:16 2011
@@ -16,7 +16,7 @@
 # limitations under the License.
 
 # -
-# Start/Stop Script for the CATALINA Server
+# Control Script for the CATALINA Server
 #
 # Environment Variable Prerequisites
 #
@@ -40,8 +40,9 @@
 #   JAVA_HOME   Must point at your Java Development Kit installation.
 #   Required to run the with the debug argument.
 #
-#   JRE_HOMEMust point at your Java Development Kit installation.
-#   Defaults to JAVA_HOME if empty.
+#   JRE_HOMEMust point at your Java Runtime installation.
+#   Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
+#   are both set, JRE_HOME is used.
 #
 #   JAVA_OPTS   (Optional) Java runtime options used when the start,
 #   stop, or run command is executed.
@@ -87,12 +88,12 @@
 
 # OS specific support.  $var _must_ be set to either true or false.
 cygwin=false
-os400=false
 darwin=false
+os400=false
 case `uname` in
 CYGWIN*) cygwin=true;;
-OS400*) os400=true;;
 Darwin*) darwin=true;;
+OS400*) os400=true;;
 esac
 
 # resolve links - $0 may be a softlink



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



svn commit: r1137568 - /tomcat/trunk/bin/tool-wrapper.sh

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:52:45 2011
New Revision: 1137568

URL: http://svn.apache.org/viewvc?rev=1137568view=rev
Log:
Make tool-wrapper.sh consistent with catalina.sh.

Modified:
tomcat/trunk/bin/tool-wrapper.sh

Modified: tomcat/trunk/bin/tool-wrapper.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/tool-wrapper.sh?rev=1137568r1=1137567r2=1137568view=diff
==
--- tomcat/trunk/bin/tool-wrapper.sh (original)
+++ tomcat/trunk/bin/tool-wrapper.sh Mon Jun 20 09:52:45 2011
@@ -20,27 +20,36 @@
 #
 # Environment Variable Prerequisites
 #
-#   CATALINA_HOME May point at your Catalina build directory.
+#   CATALINA_HOME   May point at your Catalina build directory.
 #
-#   TOOL_OPTS (Optional) Java runtime options used when the start,
-# stop, or run command is executed.
+#   TOOL_OPTS   (Optional) Java runtime options.
 #
-#   JAVA_HOME Must point at your Java Development Kit installation.
+#   JAVA_HOME   Must point at your Java Development Kit installation.
+#   Using JRE_HOME instead works as well.
 #
-#   JAVA_OPTS (Optional) Java runtime options used when the start,
-# stop, or run command is executed.
+#   JRE_HOMEMust point at your Java Runtime installation.
+#   Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
+#   are both set, JRE_HOME is used.
+#
+#   JAVA_OPTS   (Optional) Java runtime options.
+#
+#   JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories
+#   containing some jars in order to allow replacement of APIs
+#   created outside of the JCP (i.e. DOM and SAX from W3C).
+#   It can also be used to update the XML parser 
implementation.
+#   Defaults to $CATALINA_HOME/endorsed.
 #
 # $Id$
 # -
 
 # OS specific support.  $var _must_ be set to either true or false.
 cygwin=false
-os400=false
 darwin=false
+os400=false
 case `uname` in
 CYGWIN*) cygwin=true;;
-OS400*) os400=true;;
 Darwin*) darwin=true;;
+OS400*) os400=true;;
 esac
 
 # resolve links - $0 may be a softlink
@@ -97,7 +106,7 @@ if $os400; then
   # 2. owned by the PRIMARY group of the user
   # this will not work if the user belongs in secondary groups
   BASEDIR=$CATALINA_HOME
-  . $CATALINA_HOME/bin/setclasspath.sh 
+  . $CATALINA_HOME/bin/setclasspath.sh
 else
   if [ -r $CATALINA_HOME/bin/setclasspath.sh ]; then
 BASEDIR=$CATALINA_HOME



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



svn commit: r1137569 - in /tomcat/trunk/bin: catalina.bat tool-wrapper.bat

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 09:53:37 2011
New Revision: 1137569

URL: http://svn.apache.org/viewvc?rev=1137569view=rev
Log:
Make variable explanations for catalina.bat
and tool-wrapper.bat consistent with their Unix
counterparts.

Modified:
tomcat/trunk/bin/catalina.bat
tomcat/trunk/bin/tool-wrapper.bat

Modified: tomcat/trunk/bin/catalina.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.bat?rev=1137569r1=1137568r2=1137569view=diff
==
--- tomcat/trunk/bin/catalina.bat (original)
+++ tomcat/trunk/bin/catalina.bat Mon Jun 20 09:53:37 2011
@@ -37,7 +37,8 @@ rem   JAVA_HOME   Must point at your
 rem   Required to run the with the debug argument.
 rem
 rem   JRE_HOMEMust point at your Java Runtime installation.
-rem   Defaults to JAVA_HOME if empty.
+rem   Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
+rem   are both set, JRE_HOME is used.
 rem
 rem   JAVA_OPTS   (Optional) Java runtime options used when the start,
 rem   stop, or run command is executed.

Modified: tomcat/trunk/bin/tool-wrapper.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/tool-wrapper.bat?rev=1137569r1=1137568r2=1137569view=diff
==
--- tomcat/trunk/bin/tool-wrapper.bat (original)
+++ tomcat/trunk/bin/tool-wrapper.bat Mon Jun 20 09:53:37 2011
@@ -20,15 +20,24 @@ rem Wrapper script for command line tool
 rem
 rem Environment Variable Prerequisites
 rem
-rem   CATALINA_HOME May point at your Catalina build directory.
+rem   CATALINA_HOME   May point at your Catalina build directory.
 rem
-rem   TOOL_OPTS (Optional) Java runtime options used when the start,
-rem stop, or run command is executed.
+rem   TOOL_OPTS   (Optional) Java runtime options.
 rem
-rem   JAVA_HOME Must point at your Java Development Kit installation.
+rem   JAVA_HOME   Must point at your Java Development Kit installation.
+rem   Using JRE_HOME instead works as well.
 rem
-rem   JAVA_OPTS (Optional) Java runtime options used when the start,
-rem stop, or run command is executed.
+rem   JRE_HOMEMust point at your Java Runtime installation.
+rem   Defaults to JAVA_HOME if empty. If JRE_HOME and JAVA_HOME
+rem   are both set, JRE_HOME is used.
+rem
+rem   JAVA_OPTS   (Optional) Java runtime options.
+rem
+rem   JAVA_ENDORSED_DIRS (Optional) Lists of of semi-colon separated 
directories
+rem   containing some jars in order to allow replacement of 
APIs
+rem   created outside of the JCP (i.e. DOM and SAX from W3C).
+rem   It can also be used to update the XML parser 
implementation.
+rem   Defaults to $CATALINA_HOME/endorsed.
 rem
 rem $Id$
 rem ---



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



DO NOT REPLY [Bug 51384] Adding http codebase to catalina.policy file causes ClassLoaderLogManager access denied exception

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51384

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX

--- Comment #1 from Mark Thomas ma...@apache.org 2011-06-20 09:54:18 UTC ---
As of Java 1.6 the combination of:
- custom LogManager
- security manager
- http codebase in security policy file
won't work.

The root cause is the following circular dependency:
- The Custom LogManager has to extend the standard LogManager
- standard LogManager starts a Cleaner that calls setContextClassloader
- that triggers a security check
- that triggers the parsing of the policy file
- that triggers a validity check of the http codebase
- that uses HttpUrlConnection
- that tries to create a Logger
- that requires LogManager to be initialised

The standard LogManager avoids this since it is viewed as System code hence all
security checks are bypassed.

I don't see a way around this without changes to java.util.logging.LogManager
and that is outside the control of the Tomcat project.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



Using eval vs. exec in shell scripts

2011-06-20 Thread Rainer Jung
Since Mladens change r918873 in March 2010 we use eval instead of exec
in the shell scripts. The svn log says:

Use eval instead direct call or exec command so that arguments with
spaces are properly handled

Eval leaves a copy of the shell process hanging around until Tomcat
shutdown. I want to experiment with different solutions, but have no
idea, what kind of whitespace use the switch from exec to eval was
supposed to change.

Mladen or whoever else understood this: can you give an example which
didn't work with the exec based scripts?

Regards,

Rainer


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



svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 12:37:01 2011
New Revision: 1137607

URL: http://svn.apache.org/viewvc?rev=1137607view=rev
Log:
Slight improvement of configtest handling in
Unix shell script:

- add to usage
- don't use CATALINA_OPTS (think memory size etc.)
- log a message if status != 0

Modified:
tomcat/trunk/bin/catalina.sh

Modified: tomcat/trunk/bin/catalina.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1137607r1=1137606r2=1137607view=diff
==
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Mon Jun 20 12:37:01 2011
@@ -482,13 +482,17 @@ elif [ $1 = stop ] ; then
 
 elif [ $1 = configtest ] ; then
 
-eval \$_RUNJAVA\ $JAVA_OPTS $CATALINA_OPTS \
+eval \$_RUNJAVA\ $JAVA_OPTS \
   -Djava.endorsed.dirs=\$JAVA_ENDORSED_DIRS\ -classpath \$CLASSPATH\ \
   -Dcatalina.base=\$CATALINA_BASE\ \
   -Dcatalina.home=\$CATALINA_HOME\ \
   -Djava.io.tmpdir=\$CATALINA_TMPDIR\ \
   org.apache.catalina.startup.Bootstrap configtest 
-exit $?
+result=$?
+if [ $result -ne 0 ]; then
+echo Configuration error detected!
+fi
+exit $result
 
 elif [ $1 = version ] ; then
 
@@ -516,6 +520,7 @@ else
   echo   stop nStop Catalina, waiting up to n seconds for the 
process to end
   echo   stop -force   Stop Catalina, wait up to 5 seconds and then use 
kill -KILL if still running
   echo   stop n -force Stop Catalina, wait up to n seconds and then use 
kill -KILL if still running
+  echo   configtestRun a basic syntax check on server.xml - check 
exit code for result
   echo   version   What version of tomcat are you running?
   echo Note: Waiting for the process to end and use of the -force option 
require that \$CATALINA_PID is defined
   exit 1



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



svn commit: r1137609 - /tomcat/trunk/bin/catalina.bat

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 12:37:57 2011
New Revision: 1137609

URL: http://svn.apache.org/viewvc?rev=1137609view=rev
Log:
Add configtest to Windows catalina.bat.

Not yet complete:

- No error code escalation
- No log message

Modified:
tomcat/trunk/bin/catalina.bat

Modified: tomcat/trunk/bin/catalina.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.bat?rev=1137609r1=1137608r2=1137609view=diff
==
--- tomcat/trunk/bin/catalina.bat (original)
+++ tomcat/trunk/bin/catalina.bat Mon Jun 20 12:37:57 2011
@@ -215,6 +215,7 @@ if %1 == debug goto doDebug
 if %1 == run goto doRun
 if %1 == start goto doStart
 if %1 == stop goto doStop
+if %1 == configtest goto doConfigTest
 if %1 == version goto doVersion
 
 echo Usage:  catalina ( commands ... )
@@ -227,6 +228,7 @@ echo   run -security Start in the cu
 echo   start Start Catalina in a separate window
 echo   start -security   Start in a separate window with security manager
 echo   stop  Stop Catalina
+echo   configtestRun a basic syntax check on server.xml
 echo   version   What version of tomcat are you running?
 goto end
 
@@ -269,6 +271,12 @@ set ACTION=stop
 set CATALINA_OPTS=
 goto execCmd
 
+:doConfigTest
+shift
+set ACTION=configtest
+set CATALINA_OPTS=
+goto execCmd
+
 :doVersion
 %_EXECJAVA% -classpath %CATALINA_HOME%\lib\catalina.jar 
org.apache.catalina.util.ServerInfo
 goto end



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



Re: Using eval vs. exec in shell scripts

2011-06-20 Thread Henri Gomez
Which script ?

Could you send us the svn link ?

2011/6/20 Rainer Jung rainer.j...@kippdata.de:
 Since Mladens change r918873 in March 2010 we use eval instead of exec
 in the shell scripts. The svn log says:

 Use eval instead direct call or exec command so that arguments with
 spaces are properly handled

 Eval leaves a copy of the shell process hanging around until Tomcat
 shutdown. I want to experiment with different solutions, but have no
 idea, what kind of whitespace use the switch from exec to eval was
 supposed to change.

 Mladen or whoever else understood this: can you give an example which
 didn't work with the exec based scripts?

 Regards,

 Rainer


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



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



Overhauling setclasspath.(bat|sh)?

2011-06-20 Thread Rainer Jung
1) Renaming

Since quite some time now the setclasspath script doesn't have anything
to do with setting a class path. It only searches for JRE / JDK and sets
up the path to the Java or JDB binary plus JAVA_ENDORSED_DIRS.

So it would be more correct to call it checkjava.sh or setupjava.sh or
whatever.

Do you think it's too late for TC 7 to rename the script?

Good ideas for a new name?

2) Removing BASEDIR

In addition it contains a validity check for BASEDIR. This is bogus:
whereever setclasspath is sources, we directly before set BASEDIR to the
path from which we source setclasspath. In addition, apart from the
validity check, BASEDIR is never ever used.

I'd say we can safely remove BASEDIR (not setting it in catalina.* and
not checking it in setclasspath.*). Makes the scripts a bit simpler.

Regards,

Rainer


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



Re: Using eval vs. exec in shell scripts

2011-06-20 Thread Mladen Turk

On 06/20/2011 01:39 PM, Rainer Jung wrote:

Since Mladens change r918873 in March 2010 we use eval instead of exec
in the shell scripts. The svn log says:

Use eval instead direct call or exec command so that arguments with
spaces are properly handled

Mladen or whoever else understood this: can you give an example which
didn't work with the exec based scripts?



eg.
export JAVA_OPTS=$JAVA_OPTS \-XX:OnError=gdb - %p\

... and
We eval for start/stop so we can get the pid.
since eval and exec behave differently when handling quoted args
this was giving different results on catalina.sh run/start


Regards
--
^TM

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



Re: Overhauling setclasspath.(bat|sh)?

2011-06-20 Thread Leon Rosenberg
On Mon, Jun 20, 2011 at 2:50 PM, Rainer Jung rainer.j...@kippdata.de wrote:
 1) Renaming

 Since quite some time now the setclasspath script doesn't have anything
 to do with setting a class path. It only searches for JRE / JDK and sets
 up the path to the Java or JDB binary plus JAVA_ENDORSED_DIRS.

 So it would be more correct to call it checkjava.sh or setupjava.sh or
 whatever.

 Do you think it's too late for TC 7 to rename the script?

 Good ideas for a new name?

2cents
Hello Rainer,

the last and only time I used setclasspath.sh I was using it to set
custom classpath (adding a folder with config to the classpath).
For me setclasspath as name made perfectly sense till now ;-)

regards
Leon
/2cents

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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Mladen Turk

On 06/20/2011 02:37 PM, rj...@apache.org wrote:

Author: rjung
Date: Mon Jun 20 12:37:01 2011
New Revision: 1137607

URL: http://svn.apache.org/viewvc?rev=1137607view=rev
Log:
Slight improvement of configtest handling in
Unix shell script:

- add to usage
- don't use CATALINA_OPTS (think memory size etc.)


Why have you choose to kill all of the existing scripts out there?
-jpda won't work any more.

Please revert that part.




Regards
--
^TM

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



Re: Using eval vs. exec in shell scripts

2011-06-20 Thread Rainer Jung
On 20.06.2011 14:52, Mladen Turk wrote:
 On 06/20/2011 01:39 PM, Rainer Jung wrote:
 Since Mladens change r918873 in March 2010 we use eval instead of exec
 in the shell scripts. The svn log says:

 Use eval instead direct call or exec command so that arguments with
 spaces are properly handled

 Mladen or whoever else understood this: can you give an example which
 didn't work with the exec based scripts?

 
 eg.
 export JAVA_OPTS=$JAVA_OPTS \-XX:OnError=gdb - %p\

Thanks for the example.

 ... and
 We eval for start/stop so we can get the pid.

And this is broken now. We used $! with exec and we still use it with
eval. But with eval $! returns the pid of a child shell and the java
process id a child of that pid.

 since eval and exec behave differently when handling quoted args
 this was giving different results on catalina.sh run/start

Yes, I got it.

I experimented with eval exec (sic!) and it looks promising. The
following tiny script is useful for experimenting:


#!/bin/sh
dir='/var/tmp/with spaces'
arg1='-Dprop1=val1 with space'
arg2=-DpropX=y -DpropY=Z
args=\$arg1\ $arg2

mkdir -p $dir
cp -p /usr/bin/sleep $dir

echo Starting using eval ...
eval \$dir\/sleep 60 $args 
pid=$!
echo PID is: $pid
ps -p $pid
kill -9 $pid

echo Starting using eval exec ...
eval exec \$dir\/sleep 60 $args 
pid=$!
echo PID is: $pid
ps -p $pid
kill -9 $pid

rm -rf $dir


I think eval exec is the right solution. Seems to behave nice for
whitespace and doesn't add an intermediate process between the startup
script and the Java process.

Regards,

Rainer


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



Re: Overhauling setclasspath.(bat|sh)?

2011-06-20 Thread Rainer Jung
On 20.06.2011 14:54, Leon Rosenberg wrote:
 On Mon, Jun 20, 2011 at 2:50 PM, Rainer Jung rainer.j...@kippdata.de wrote:
 1) Renaming

 Since quite some time now the setclasspath script doesn't have anything
 to do with setting a class path. It only searches for JRE / JDK and sets
 up the path to the Java or JDB binary plus JAVA_ENDORSED_DIRS.

 So it would be more correct to call it checkjava.sh or setupjava.sh or
 whatever.

 Do you think it's too late for TC 7 to rename the script?

 Good ideas for a new name?

 2cents
 Hello Rainer,
 
 the last and only time I used setclasspath.sh I was using it to set
 custom classpath (adding a folder with config to the classpath).
 For me setclasspath as name made perfectly sense till now ;-)
 
 regards
 Leon
 /2cents

The right place for this and any other customization of the startup
variables is setenv.sh. Another reason for renaming ;)

Regards,

Rainer

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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Rainer Jung
On 20.06.2011 14:56, Mladen Turk wrote:
 On 06/20/2011 02:37 PM, rj...@apache.org wrote:
 Author: rjung
 Date: Mon Jun 20 12:37:01 2011
 New Revision: 1137607

 URL: http://svn.apache.org/viewvc?rev=1137607view=rev
 Log:
 Slight improvement of configtest handling in
 Unix shell script:

 - add to usage
 - don't use CATALINA_OPTS (think memory size etc.)
 
 Why have you choose to kill all of the existing scripts out there?

I haven't ;)

 -jpda won't work any more.
 
 Please revert that part.

I'll check.

Rainer

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



DO NOT REPLY [Bug 51328] StringManager/ResourceBundle parsing error causes webapp deployment to fail on ppc64 gcj

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51328

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEEDINFO|RESOLVED
 Resolution||INVALID

--- Comment #2 from Mark Thomas ma...@apache.org 2011-06-20 13:16:56 UTC ---
No response to Konstantin's questions and since gcj is known to have all sorts
of issues, resolving this as invalid since it appears to be (another) gcj
issue.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Mladen Turk

On 06/20/2011 03:16 PM, Rainer Jung wrote:

On 20.06.2011 14:56, Mladen Turk wrote:

On 06/20/2011 02:37 PM, rj...@apache.org wrote:

Author: rjung
Date: Mon Jun 20 12:37:01 2011
New Revision: 1137607

URL: http://svn.apache.org/viewvc?rev=1137607view=rev
Log:
Slight improvement of configtest handling in
Unix shell script:

- add to usage
- don't use CATALINA_OPTS (think memory size etc.)


Why have you choose to kill all of the existing scripts out there?


I haven't ;)



Yes you did. I have a bunch of users that really on CATALINA_OPTS
to get passed to the tomcat. Now that's gone :(

See the catalina.sh comment (still there)
#
#   CATALINA_OUT(Optional) Full path to a file where stdout and stderr
#   will be redirected.
#   Default is $CATALINA_BASE/logs/catalina.out
#
#   CATALINA_OPTS   (Optional) Java runtime options used when the start,
#   or run command is executed.
#
#   CATALINA_TMPDIR (Optional) Directory path location of temporary directory
#   the JVM should use (java.io.tmpdir).  Defaults to
#   $CATALINA_BASE/temp.


Just don't see what was the problem with that option that
would require it to go away. This wasn't discussed on the dev list
so if I weren't tracking the svn commits it would be a big surprise on
the next tomcat release.


Cheers
--
^TM

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



DO NOT REPLY [Bug 51124] ArrayIndexOutOfBoundsException after setting org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51124

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Mark Thomas ma...@apache.org 2011-06-20 13:27:07 UTC ---
Fixed in 6.0.x and will be included in 6.0.33 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137627 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt java/org/apache/jasper/runtime/BodyContentImpl.java webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 13:26:12 2011
New Revision: 1137627

URL: http://svn.apache.org/viewvc?rev=1137627view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51124
Make Tomcat more robust if an OOME occurs. Usually after an OOME all bets are 
off but this change appears to help some users and the description of a 
'recoverable' OOME in the bug is a plausible one.
Based on a patch by Ramiro.

Modified:
tomcat/tc6.0.x/trunk/   (props changed)
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/jasper/runtime/BodyContentImpl.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 20 13:26:12 2011
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
 
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041,791184,791194,791224,791243,791326,791328,791789,792740,793372,793757,793882,793981,794082,794673,794822,795043,795152,795210,795457,795466,797168,797425,797596,797607,802727,802940,804462,804544,804734,805153,809131,809603,810916,810977,812125,812137,812432,813001,813013,813866,814180,814708,814876,815972,816252,817442,817822,819339,819361,820110,820132,820874,820954,821397,828196,828201,828210,828225,828759,830378-830379,830999,831106,831774,831785,831828,831850,831860,832214,832218,833121,833545,834047,835036,835336,836405,881396,881412,883130,883134,883146,883165,883177,883362,883565,884341,885038,885231,885241,885260,885901,885991,886019,888072,889363,889606,889716,8901
 
39,890265,890349-890350,890417,891185-891187,891583,892198,892341,892415,892464,892555,892812,892814,892817,892843,892887,893321,893493,894580,894586,894805,894831,895013,895045,895057,895191,895392,895703,896370,896384,897380-897381,897776,898126,898256,898468,898527,898555,898558,898718,898836,898906,899284,899348,899420,899653,899769-899770,899783,899788,899792,899916,899918-899919,899935,899949,903916,905020,905151,905722,905728,905735,907311,907513,907538,907652,907819,907825,907864,908002,908721,908754,908759,909097,909206,909212,909525,909636,909869,909875,909887,910266,910370,910442,910471,910485,910974,915226,915737,915861,916097,916141,916157,916170,917598,917633,918093,918489,918594,918684,918787,918792,918799,918803,918885,919851,919914,920025,920055,920298,920449,920596,920824,920840,921444,922010,926716,927062,927621,928482,928695,928732,928798,931709,932357,932967,935105,935983,939491,939551,940064,941356,941463,943112,944409,944416,945231,945808,945835,945841
 
,946686,948057,950164,950596,950614,950851,950905,951615,953434,954435,955648,955655,956832,957130,957830,958192,960701,961948,962865,962872,962881,962900,963106,963865,963868,964614,966177-966178,966292,966692,966863,981815,988448,991837,993042,1001955,1002185,1002263,1002274,1002349,1002359,1002362,1002481,1002514,1003461,1003481,1003488,1003556,1003572,1003581,1003861,1004393,1004409,1004415,1004868-1004869,1004912,1005452,1005467,1005647,1005802,1022120,1022134,1022323,1022415,1022606,1022623,1024224,1024251,1026042,1026784,1026912,1026920,1029767,1033415,1033448,1033842,1033897,1037715,1037794,1037887,1037924,1038041,1042022,1042029,1042447,1042452,1042494,1044944,1044987,1050249,1055055,1055236,1055458,1055975,1056264,1056828,1056889,1059881,1061412,1061442,1061446,1062398,1064652,1066244,1067039,1067139,1069824,1070139,1070420,1070609,1072042,1075458,1076212,1078409,1078412,1079801,1081334,1088179,1088460,1094069,1094089,1099586,1099772,1099789,1100145,1100822,1101094
 ,1101144,1130774

Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Mark Thomas
On 20/06/2011 14:21, Mladen Turk wrote:
 Just don't see what was the problem with that option that
 would require it to go away. This wasn't discussed on the dev list
 so if I weren't tracking the svn commits it would be a big surprise on
 the next tomcat release.

Look at the patch again. It only removes the option for configtest

Mark



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



Re: Overhauling setclasspath.(bat|sh)?

2011-06-20 Thread Leon Rosenberg
now when you say it, it does really make sense ;-)
thanx
leon

On Mon, Jun 20, 2011 at 3:15 PM, Rainer Jung rainer.j...@kippdata.de wrote:
 On 20.06.2011 14:54, Leon Rosenberg wrote:
 On Mon, Jun 20, 2011 at 2:50 PM, Rainer Jung rainer.j...@kippdata.de wrote:
 1) Renaming

 Since quite some time now the setclasspath script doesn't have anything
 to do with setting a class path. It only searches for JRE / JDK and sets
 up the path to the Java or JDB binary plus JAVA_ENDORSED_DIRS.

 So it would be more correct to call it checkjava.sh or setupjava.sh or
 whatever.

 Do you think it's too late for TC 7 to rename the script?

 Good ideas for a new name?

 2cents
 Hello Rainer,

 the last and only time I used setclasspath.sh I was using it to set
 custom classpath (adding a folder with config to the classpath).
 For me setclasspath as name made perfectly sense till now ;-)

 regards
 Leon
 /2cents

 The right place for this and any other customization of the startup
 variables is setenv.sh. Another reason for renaming ;)

 Regards,

 Rainer

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



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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Rainer Jung
On 20.06.2011 14:56, Mladen Turk wrote:
 On 06/20/2011 02:37 PM, rj...@apache.org wrote:
 Author: rjung
 Date: Mon Jun 20 12:37:01 2011
 New Revision: 1137607

 URL: http://svn.apache.org/viewvc?rev=1137607view=rev
 Log:
 Slight improvement of configtest handling in
 Unix shell script:

 - add to usage
 - don't use CATALINA_OPTS (think memory size etc.)
 
 Why have you choose to kill all of the existing scripts out there?
 -jpda won't work any more.
 
 Please revert that part.

Hmmm, after checking, I don't understand.

Did you see the configtest in the above log message?

This is not about start, only about configtest.sh.

So do you have an actual problem with jpda or did you only think there
is a problem?

Regards,

Rainer

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



svn commit: r1137629 - in /tomcat/tc6.0.x/trunk: ./ STATUS.txt java/org/apache/catalina/Context.java java/org/apache/catalina/session/ManagerBase.java webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 13:38:23 2011
New Revision: 1137629

URL: http://svn.apache.org/viewvc?rev=1137629view=rev
Log:
Expose a container event for changing the session ID

Modified:
tomcat/tc6.0.x/trunk/   (props changed)
tomcat/tc6.0.x/trunk/STATUS.txt
tomcat/tc6.0.x/trunk/java/org/apache/catalina/Context.java
tomcat/tc6.0.x/trunk/java/org/apache/catalina/session/ManagerBase.java
tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc6.0.x/trunk/
--
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jun 20 13:38:23 2011
@@ -1 +1 @@
-/tomcat/trunk:601180,606992,612607,630314,640888,652744,653247,666232,673796,673820,677910,683969,683982,684001,684081,684234,684269-684270,685177,687503,687645,689402,690781,691392,691805,692748,693378,694992,695053,695311,696780,696782,698012,698227,698236,698613,699427,699634,701355,709294,709811,709816,710063,710066,710125,710205,711126,711600,712461,712467,713953,714002,718360,719119,719124,719602,719626,719628,720046,720069,721040,721286,721708,721886,723404,723738,726052,727303,728032,728768,728947,729057,729567,729569,729571,729681,729809,729815,729934,730250,730590,731651,732859,732863,734734,740675,740684,742677,742697,742714,744160,744238,746321,746384,746425,747834,747863,748344,750258,750291,750921,751286-751287,751289,751295,752323,753039,757335,757774,758249,758365,758596,758616,758664,759074,761601,762868,762929,762936-762937,763166,763183,763193,763228,763262,763298,763302,763325,763599,763611,763654,763681,763706,764985,764997,765662,768335,769979,770716,77
 
0809,770876,772872,776921,776924,776935,776945,777464,777466,777576,777625,778379,778523-778524,781528,781779,782145,782791,783316,783696,783724,783756,783762,783766,783863,783934,784453,784602,784614,785381,785688,785768,785859,786468,786487,786490,786496,786667,787627,787770,787985,789389,790405,791041,791184,791194,791224,791243,791326,791328,791789,792740,793372,793757,793882,793981,794082,794673,794822,795043,795152,795210,795457,795466,797168,797425,797596,797607,802727,802940,804462,804544,804734,805153,809131,809603,810916,810977,812125,812137,812432,813001,813013,813866,814180,814708,814876,815972,816252,817442,817822,819339,819361,820110,820132,820874,820954,821397,828196,828201,828210,828225,828759,830378-830379,830999,831106,831774,831785,831828,831850,831860,832214,832218,833121,833545,834047,835036,835336,836405,881396,881412,883130,883134,883146,883165,883177,883362,883565,884341,885038,885231,885241,885260,885901,885991,886019,888072,889363,889606,889716,8901
 
39,890265,890349-890350,890417,891185-891187,891583,892198,892341,892415,892464,892555,892812,892814,892817,892843,892887,893321,893493,894580,894586,894805,894831,895013,895045,895057,895191,895392,895703,896370,896384,897380-897381,897776,898126,898256,898468,898527,898555,898558,898718,898836,898906,899284,899348,899420,899653,899769-899770,899783,899788,899792,899916,899918-899919,899935,899949,903916,905020,905151,905722,905728,905735,907311,907513,907538,907652,907819,907825,907864,908002,908721,908754,908759,909097,909206,909212,909525,909636,909869,909875,909887,910266,910370,910442,910471,910485,910974,915226,915737,915861,916097,916141,916157,916170,917598,917633,918093,918489,918594,918684,918787,918792,918799,918803,918885,919851,919914,920025,920055,920298,920449,920596,920824,920840,921444,922010,926716,927062,927621,928482,928695,928732,928798,931709,932357,932967,935105,935983,939491,939551,940064,941356,941463,943112,944409,944416,945231,945808,945835,945841
 
,946686,948057,950164,950596,950614,950851,950905,951615,953434,954435,955648,955655,956832,957130,957830,958192,960701,961948,962865,962872,962881,962900,963106,963865,963868,964614,966177-966178,966292,966692,966863,981815,988448,991837,993042,1001955,1002185,1002263,1002274,1002349,1002359,1002362,1002481,1002514,1003461,1003481,1003488,1003556,1003572,1003581,1003861,1004393,1004409,1004415,1004868-1004869,1004912,1005452,1005467,1005647,1005802,1022120,1022134,1022323,1022415,1022606,1022623,1024224,1024251,1026042,1026784,1026912,1026920,1029767,1033415,1033448,1033842,1033897,1037715,1037794,1037887,1037924,1038041,1042022,1042029,1042447,1042452,1042494,1044944,1044987,1050249,1055055,1055236,1055458,1055975,1056264,1056828,1056889,1059881,1061412,1061442,1061446,1062398,1064652,1066244,1067039,1067139,1069824,1070139,1070420,1070609,1072042,1075458,1076212,1078409,1078412,1079801,1081334,1088179,1088460,1094069,1094089,1099575,1099586,1099772,1099789,1100145,1100822
 ,1101094,1101144,1130774

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

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 13:42:58 2011
New Revision: 1137630

URL: http://svn.apache.org/viewvc?rev=1137630view=rev
Log:
Vote

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=1137630r1=1137629r2=1137630view=diff
==
--- tomcat/tc6.0.x/trunk/STATUS.txt (original)
+++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Jun 20 13:42:58 2011
@@ -149,5 +149,5 @@ PATCHES PROPOSED TO BACKPORT:
   -When the session expiration is received, the session message is never 
transmitted to a primary node. 
   http://svn.apache.org/viewvc?rev=1135069view=rev
-  +1: kfujino, schultz
+  +1: kfujino, schultz, markt
   -1:



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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Konstantin Kolinko
2011/6/20 Mladen Turk mt...@apache.org:

 Look at the patch again. It only removes the option for configtest


 It depends what you have in CATALINA_OPTS.
 If you have -d32/-d64 this won't get picked.
 However still don't get it why it was removed?

 Funny, but I was actually trying to add $CATALINA_OPTS
 to the version command, so we get consistent JVM behavior.


-d32/-d64 flag should go into JAVA_OPTS, so that stop command were
using it as well.

Maybe let version command to print out the content of
JAVA_OPTS and CATALINA_OPTS variables?

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: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Rainer Jung
On 20.06.2011 15:41, Mladen Turk wrote:
 On 06/20/2011 03:28 PM, Mark Thomas wrote:
 On 20/06/2011 14:21, Mladen Turk wrote:
 Just don't see what was the problem with that option that
 would require it to go away. This wasn't discussed on the dev list
 so if I weren't tracking the svn commits it would be a big surprise on
 the next tomcat release.

 Look at the patch again. It only removes the option for configtest

 
 It depends what you have in CATALINA_OPTS.
 If you have -d32/-d64 this won't get picked.
 However still don't get it why it was removed?
 
 Funny, but I was actually trying to add $CATALINA_OPTS
 to the version command, so we get consistent JVM behavior.

We do have two options, JAVA_OPTS and CATALINA_OPTS. The only difference
between them is, for which of the catalina.sh subcommand they are used.

- JAVA_OPTS for all
- CATALINA_OPTS only for starting (and run and debug)

Why are there 2 option lists?

Because at least for the memory sizing you need to have a split. If you
run production tomcat with say 2GB heap, and add the same flag when
running version or stop, then you will temporrarily try to start another
2GB Java process.

Another example are the jmx listeners. If you add a port via the sun
management system property and add it to the stop or version command as
well, the JVM will not be able to start, so the version or stop command
will fail.

In general all commands except those that start a Tomcat (and thus
deploy webapps etc.) should not use that type of params. They should go
into CATALINA_OPTS. Everything that you can use multiple times in
parallel, even for the helper programs can go in JAVA_OPTS.

Regards,

Rainer

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



Re: Using eval vs. exec in shell scripts

2011-06-20 Thread Mladen Turk

On 06/20/2011 03:12 PM, Rainer Jung wrote:



... and
We eval for start/stop so we can get the pid.


And this is broken now. We used $! with exec and we still use it with
eval. But with eval $! returns the pid of a child shell and the java
process id a child of that pid.



Are you sure?

cat EOF foo.sh
#!/bin/sh
eval sleep \$@ 
echo Sleep pid: \$!
exit 0
EOF

[mturk@fc14x86v0 Temp]$ sh foo.sh 30
Sleep pid: 3998
[mturk@fc14x86v0 Temp]$ ps -ef | grep sleep
...
mturk 3998 1  0 15:58 pts/300:00:00 sleep 30
...


Regards
--
^TM

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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Mladen Turk

On 06/20/2011 03:53 PM, Rainer Jung wrote:

On 20.06.2011 15:41, Mladen Turk wrote:

In general all commands except those that start a Tomcat (and thus
deploy webapps etc.) should not use that type of params. They should go
into CATALINA_OPTS. Everything that you can use multiple times in
parallel, even for the helper programs can go in JAVA_OPTS.



Hmm, make sense.
Seems there is general missunderstanding of those two.
People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.

Dunno what to think actually at the moment.

Regards
--
^TM

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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Mladen Turk

On 06/20/2011 03:28 PM, Mark Thomas wrote:

On 20/06/2011 14:21, Mladen Turk wrote:

Just don't see what was the problem with that option that
would require it to go away. This wasn't discussed on the dev list
so if I weren't tracking the svn commits it would be a big surprise on
the next tomcat release.


Look at the patch again. It only removes the option for configtest



It depends what you have in CATALINA_OPTS.
If you have -d32/-d64 this won't get picked.
However still don't get it why it was removed?

Funny, but I was actually trying to add $CATALINA_OPTS
to the version command, so we get consistent JVM behavior.


Regards
--
^TM

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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Filip Hanik - Dev Lists

On 6/20/2011 8:06 AM, Mladen Turk wrote:

On 06/20/2011 03:53 PM, Rainer Jung wrote:

On 20.06.2011 15:41, Mladen Turk wrote:

In general all commands except those that start a Tomcat (and thus
deploy webapps etc.) should not use that type of params. They should go
into CATALINA_OPTS. Everything that you can use multiple times in
parallel, even for the helper programs can go in JAVA_OPTS.



Hmm, make sense.
Seems there is general missunderstanding of those two.
People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.

don't matter what people put where, as long as we don't break backwards 
compatibility.

as long as configtest doesn't rely on system variables that can be put 
CATALINA_OPTS, such as -Dhttp.port=8080 :)





Dunno what to think actually at the moment.

Regards



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



Re: svn commit: r1137607 - /tomcat/trunk/bin/catalina.sh

2011-06-20 Thread Rainer Jung
On 20.06.2011 16:06, Mladen Turk wrote:
 On 06/20/2011 03:53 PM, Rainer Jung wrote:
 On 20.06.2011 15:41, Mladen Turk wrote:

 In general all commands except those that start a Tomcat (and thus
 deploy webapps etc.) should not use that type of params. They should go
 into CATALINA_OPTS. Everything that you can use multiple times in
 parallel, even for the helper programs can go in JAVA_OPTS.

 
 Hmm, make sense.
 Seems there is general missunderstanding of those two.
 People usually put in JAVA_OPTS what actually belongs to CATALINA_OPTS.
 
 Dunno what to think actually at the moment.

Yes, I always thought the names are confusing. But probably much to late
now. The split was introduced long ago in TC 6 times.

If we change it, we break peoples config who set them in setenv.

One can make some sense out of the name: CATALINA_OPTS are the ones that
CATALINA=Tomcat needs to run.

Regards,

Rainer

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



svn commit: r1137638 - in /tomcat/trunk/java/org/apache/coyote/http11: Http11AprProcessor.java Http11AprProtocol.java

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 14:24:19 2011
New Revision: 1137638

URL: http://svn.apache.org/viewvc?rev=1137638view=rev
Log:
Remove unnecessary code.

Modified:
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java?rev=1137638r1=1137637r2=1137638view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java 
(original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java Mon Jun 
20 14:24:19 2011
@@ -343,15 +343,8 @@ public class Http11AprProcessor extends 
 
 }
 
-/* Copied from the AjpProcessor.java */
-public SocketState asyncDispatch(SocketWrapperLong socket,
-SocketStatus status) {
 
-// Setting up the socket
-this.socket = socket;
-long socketRef = socket.getSocket().longValue();
-inputBuffer.setSocket(socketRef);
-outputBuffer.setSocket(socketRef);
+public SocketState asyncDispatch(SocketStatus status) {
 
 RequestInfo rp = request.getRequestProcessor();
 try {

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1137638r1=1137637r2=1137638view=diff
==
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Jun 
20 14:24:19 2011
@@ -230,7 +230,7 @@ public class Http11AprProtocol extends A
 SocketState state = SocketState.CLOSED;
 do {
 if (processor.isAsync() || state == SocketState.ASYNC_END) 
{
-state = processor.asyncDispatch(socket, status);
+state = processor.asyncDispatch(status);
 } else if (processor.comet) {
 state = processor.event(status);
 } else {



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



OneLineFormatter by default?

2011-06-20 Thread Rainer Jung
Should we use the new OneLineFormatter as the default juli formatter?

I never found anyone who liked the default java.util.logging log format,
which spreads all messages out via two lines. One line contains the
timestamp, the other line the message.

So if your grep for a message, you want find out when it was issued, and
if you look for a certain time range, yout wont see the actual messages.
Non-sense.

Now that we have our nice little OneLineFormatter, why not use it as
default?

If we use it as default: should be have it as default without config,
i.e. as a default in code, or do we want to add the .formatter lines to
our loggging.properties? Or add the formatter system property to
catalina.properties?

I think I would favor having it as a code default, i.e. without any
configuration.

Any comments?

Regards,

Rainer


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



Re: OneLineFormatter by default?

2011-06-20 Thread Mark Thomas
On 20/06/2011 15:51, Rainer Jung wrote:
 Should we use the new OneLineFormatter as the default juli formatter?
 
 I never found anyone who liked the default java.util.logging log format,
 which spreads all messages out via two lines. One line contains the
 timestamp, the other line the message.
 
 So if your grep for a message, you want find out when it was issued, and
 if you look for a certain time range, yout wont see the actual messages.
 Non-sense.
 
 Now that we have our nice little OneLineFormatter, why not use it as
 default?
 
 If we use it as default: should be have it as default without config,
 i.e. as a default in code, or do we want to add the .formatter lines to
 our loggging.properties? Or add the formatter system property to
 catalina.properties?
 
 I think I would favor having it as a code default, i.e. without any
 configuration.

That might be a surprise for users.

I'd lean towards make it the default via config (very easy to revert)
and change the code default for 8.x onwards.

Mark



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



svn commit: r1137646 - /tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 14:57:37 2011
New Revision: 1137646

URL: http://svn.apache.org/viewvc?rev=1137646view=rev
Log:
Packages tag files have jndi URLs not file URLs

Modified:
tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java

Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1137646r1=1137645r2=1137646view=diff
==
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Mon Jun 20 
14:57:37 2011
@@ -295,7 +295,7 @@ public class JspCompilationContext {
 // May not be in a JAR in some IDE environments
 result = context.getResource(canonicalURI(res));
 }
-} else if (res.startsWith(jar:file:)) {
+} else if (res.startsWith(jar:jndi:)) {
 // This is a tag file packaged in a jar that is being checked
 // for a dependency
 result = new URL(res);



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



DO NOT REPLY [Bug 51395] New: First application that loads SAXParserFactory causes Class loader memory leak

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51395

 Bug #: 51395
   Summary: First application that loads SAXParserFactory causes
Class loader memory leak
   Product: Tomcat 7
   Version: 7.0.14
  Platform: PC
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: arjencornelis.kni...@getronics.com
Classification: Unclassified


Overview
The class org.apache.catalina.startup.ContextConfig has an array of
org.apache.tomcat.util.digester.Digester objects. Each Digester has a field
factory to refer to a SAXParserFactory. If that SAXParserFactory is loaded via
a WebappClassLoader, that WebappClassLoader is stuck in memory.

Steps to reproduce
Create a Web application that has xercesImpl.jar in its lib. (The Web
application itself doesn't need to use any of the xerces classes.) Upload the
application war file using Tomcat Manager. Verify that the application is
loaded via Tomcat Manager - List Applications

Restart Tomcat. Via Tomcat Manager - List Applications, verify that the
application is running. Undeploy the application. Click on Find leaks. The
message above shows the application as leaking.

Make a memory dump using jmap, inspect the memory using jhat.
The WebappClassLoader for this application is still present. Its reference
chains from rootset shows a chain like this:
Static reference from org.apache.catalina.startup.ContextConfig.webDigesters
(from class org.apache.catalina.startup.ContextConfig) :
-- [Lorg.apache.tomcat.util.digester.Digester;@0x78be4958 (24 bytes) (Element
0 of [Lorg.apache.tomcat.util.digester.Digester;@0x78be4958:)
-- org.apache.tomcat.util.digester.Digester@0x78be3c50 (101 bytes) (field
factory:)
-- org.apache.xerces.jaxp.SAXParserFactoryImpl@0x78bf0b28 (20 bytes) (??:)
-- class org.apache.xerces.jaxp.SAXParserFactoryImpl (84 bytes) (??:)
-- org.apache.catalina.loader.WebappClassLoader@0x78be3ea0 (165 bytes)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51395] First application that loads SAXParserFactory causes Class loader memory leak

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51395

--- Comment #1 from Arjen Knibbe arjencornelis.kni...@getronics.com 
2011-06-20 15:07:59 UTC ---
Created attachment 27179
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27179
Minimal web application with xercesImpl in lib

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51395] First application that loads SAXParserFactory causes Class loader memory leak

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51395

--- Comment #2 from Arjen Knibbe arjencornelis.kni...@getronics.com 
2011-06-20 15:08:46 UTC ---
Created attachment 27180
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27180
Minimal web application with xercesImpl in lib - second part

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137652 - /tomcat/trunk/webapps/docs/changelog.xml

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 15:11:59 2011
New Revision: 1137652

URL: http://svn.apache.org/viewvc?rev=1137652view=rev
Log:
Add note about script changes.

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137652r1=1137651r2=1137652view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 15:11:59 2011
@@ -64,14 +64,14 @@
 so only types of interest are reported to a 
ServletContainerInitializer.
 (markt)
   /fix
-  fix
+  add
 bug49165/bug: Allow any time stamp formats supported by 
SimpleDateFormat
 in AccessLogValve. Support logging begin and/or end of request. (rjung)
-  /fix
-  add
+  /add
+  update
 Add the Tomcat extras JARs to the list of JARs to skip when scanning
 for TLDs and web fragments. (rjung)
-  /add
+  /update
 /changelog
   /subsection
   subsection name=Coyote
@@ -127,6 +127,13 @@
   /fix
 /changelog
   /subsection
+  subsection name=Other
+changelog
+  update
+Clean up shell and batch scripts for consistency. (rjung)
+  /update
+/changelog
+  /subsection
 /section
 section name=Tomcat 7.0.16 (markt) rtext=released 2011-06-17
   subsection name=Catalina



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



Re: Wiki spam prevention measure

2011-06-20 Thread sebb
On 19 June 2011 15:20, Konstantin Kolinko knst.koli...@gmail.com wrote:
 2011/6/19 sebb seb...@gmail.com:
 Gavin recently updated the details of how the ASF Wiki works, and
 added details of how SpamAssassin have completely stopped spam
 happening:

 http://wiki.apache.org/general/OurWikiFarm#per_wiki_access_control_-_tighten_your_wiki_just_a_little.2C_benefit_just_a_lot

 Might be worth considering for Tomcat?

 The ContributorsGroup could be pre-populated with recent 'ham' contributors.


 Thank you, Sebastian.

 Configuring a ContributorsGroup has its drawbacks and I am not ready for 
 those.

 1) Admins are few and they are not here 7*24 to add people.

You can always add more admins from the pool of people on the user
list - I expect there are a few who would be happy to help.


 2) There is PoweredBy page that has hundred of different authors.

 I am not ready to manage those people.

There are lots more potential spammers.
And spammers may have to be dealt with multiple times, whereas a
contributor just needs to be added once.

There were approximately 60 edits to that page in 2011 so far, of
which at least 37 were spam or despam.

That's about 1 valid edit per week for that page.

But of course it is up to the Tomcat developers to decide on how they
want to manage their Wiki.

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



svn commit: r1137693 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 16:38:40 2011
New Revision: 1137693

URL: http://svn.apache.org/viewvc?rev=1137693view=rev
Log:
The fix for bug 51310 caused a regression that re-introduced bug 49957 and 
deleted the contents of the work directory when Tomcat was shutdown. This fix 
ensures that that work directory for an application is not deleted when Tomcat 
is shutdown.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1137693r1=1137692r2=1137693view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Jun 20 
16:38:40 2011
@@ -58,6 +58,8 @@ import org.apache.catalina.Lifecycle;
 import org.apache.catalina.LifecycleEvent;
 import org.apache.catalina.LifecycleListener;
 import org.apache.catalina.Pipeline;
+import org.apache.catalina.Server;
+import org.apache.catalina.Service;
 import org.apache.catalina.Valve;
 import org.apache.catalina.Wrapper;
 import org.apache.catalina.core.ContainerBase;
@@ -1090,6 +1092,12 @@ public class ContextConfig
 if (log.isDebugEnabled())
 log.debug(sm.getString(contextConfig.destroy));
 
+// Skip clearing the work directory if Tomcat is being shutdown
+Server s = getServer();
+if (s != null  !s.getState().isAvailable()) {
+return;
+}
+
 // Changed to getWorkPath per Bugzilla 35819.
 String workDir = ((StandardContext) context).getWorkPath();
 if (workDir != null)
@@ -1097,6 +1105,25 @@ public class ContextConfig
 }
 
 
+private Server getServer() {
+Container c = context;
+while (c != null  !(c instanceof Engine)) {
+c = c.getParent();
+}
+
+if (c == null) {
+return null;
+}
+
+Service s = ((Engine)c).getService();
+
+if (s == null) {
+return null;
+}
+
+return s.getServer();
+}
+
 /**
  * Validate the usage of security role names in the web application
  * deployment descriptor.  If any problems are found, issue warning

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137693r1=1137692r2=1137693view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 16:38:40 2011
@@ -72,6 +72,12 @@
 Add the Tomcat extras JARs to the list of JARs to skip when scanning
 for TLDs and web fragments. (rjung)
   /update
+  fix
+The fix for bug bug51310/bug caused a regression that re-introduced
+bug bug49957/bug and deleted the contents of the work directory
+when Tomcat was shutdown. This fix ensures that that work directory for
+an application is not deleted when Tomcat is shutdown. (mark)
+  /fix
 /changelog
   /subsection
   subsection name=Coyote



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



Re: OneLineFormatter by default?

2011-06-20 Thread Konstantin Kolinko
2011/6/20 Rainer Jung rainer.j...@kippdata.de:
 Should we use the new OneLineFormatter as the default juli formatter?

 I never found anyone who liked the default java.util.logging log format,
 which spreads all messages out via two lines. One line contains the
 timestamp, the other line the message.

 So if your grep for a message, you want find out when it was issued, and
 if you look for a certain time range, yout wont see the actual messages.
 Non-sense.

 Now that we have our nice little OneLineFormatter, why not use it as
 default?


I like the default SimpleFormatter. With the SimpleFormatter those
messages fit better when they are printed into console window. It is
easier to read through the log files as well.

With OneLineFormatter the messages are shifted to the right. The
offset is arbitrary, because class names before the message have
arbitrary length. Enabling line wrapping in file viewer is possible,
but does not make those lines more readable. It is hard to read.

I think SimpleFormatter should stay as the default.


Some nitpicks looking at the source code of OneLineFormatter.

1) OneLineFormatter#currentDate and currentDateString are used in
double locking. If I understand it correctly, the should be made
volatile. Though see the next point.

2) I do not understand why OneLineFormatter#addTimestamp( ) method is public.

It could be protected. It is not used anywhere else. Furthermore, the
only place where it is called, the #format() method,  always creates a
new instance of Date object.  Thus if (currentDate != date)
comparison of object instances does not make sense.

3) msec value looses its leading zero. E.g. in two subsequent lines:

20-Jun-2011 20:25:25.46
20-Jun-2011 20:25:25.531

4) SimpleFormatter#format() delegates message formatting to
Formatter#formatMessage(..) which performs lookup through a resource
bundle and does formatting of parameters.

OneLineFormatter does not do it. It just uses the message as String.
It is not of much difference for Tomcat, because Tomcat does not use
java.util.logging directly, but some other webapps may use it.
(Not a very strong argument though).

 If we use it as default: should be have it as default without config,
 i.e. as a default in code, or do we want to add the .formatter lines to
 our loggging.properties? Or add the formatter system property to
 catalina.properties?

 I think I would favor having it as a code default, i.e. without any
 configuration.


In the code you can change default for the JULI's FileHandler only.
(Unless you tweak properties loading itself).  There are other Handler
implementations there.

If it were changed I'd prefer it to be in the configuration.


Regarding grep:
Some grep implementations (e.g. the GNU one) have
 --context, --before-context, --after-context options to print several lines
of context for each match
(section 2.1.5 in [1]).

[1]: http://www.gnu.org/software/grep/manual/

Best regards,
Konstantin Kolinko

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



DO NOT REPLY [Bug 51396] New: Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

 Bug #: 51396
   Summary: Embedding class cannot launch a webapp with a jsp
servlet
   Product: Tomcat 7
   Version: 7.0.16
  Platform: PC
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: bimargul...@gmail.com
Classification: Unclassified


https://github.com/bimargulies/Tomcat-Solr-Test-Case is a test case. It creates
an instance of Tomcat and then adds a webapp from Apache Solr. This webapp has
'jsp' servlets.

The code crashes, because the implicit default web.xml used in this case does
not include a servlet named jsp, resulting in the following backtrace.



2011-06-20 12:56:24,598 [Embedded Tomcat] INFO
org.apache.catalina.startup.ContextConfig - No global web.xml found
Exception in thread Embedded Tomcat java.lang.NullPointerException
at
org.apache.catalina.startup.ContextConfig.convertJsp(ContextConfig.java:1379)
at
org.apache.catalina.startup.ContextConfig.convertJsps(ContextConfig.java:1358)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1349)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:881)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:316)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:509)
at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:483)
at org.apache.catalina.startup.Tomcat.addWebapp(Tomcat.java:171)
at
org.apache.tomcat.tc.solrWebapp.LaunchWithSolr.tryToAddSolr(LaunchWithSolr.java:111)
at
org.apache.tomcat.tc.solrWebapp.LaunchWithSolr.access$1(LaunchWithSolr.java:106)
at
org.apache.tomcat.tc.solrWebapp.LaunchWithSolr$1.run(LaunchWithSolr.java:91)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

bmargulies bimargul...@gmail.com changed:

   What|Removed |Added

 OS/Version||All
   Severity|normal  |major

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID

--- Comment #1 from Mark Thomas ma...@apache.org 2011-06-20 17:04:32 UTC ---
Look at the test cases for examples of how to do this.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

bmargulies bimargul...@gmail.com changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |

--- Comment #2 from bmargulies bimargul...@gmail.com 2011-06-20 17:10:06 UTC 
---
 It stuns me that you would close this without apparently taking 2 minutes to
read the one Java class, which I wrote by reading the available doc and
examples. Further, I spend several hours debugging into tomcat here, and there
were a number of suspicious aspects that led me to think that a bugzilla was
appropriate.

Further, this is code that worked with tomcat 6 embedded and only failed when I
moved to tomcat 7.

My code was written from the available examples, it works fine for a webapp
that jsp pages but not jsp servlets, and the webapp with jsp servlets works
fine with unembedded tomcat.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



Re: Fixing bug 33453

2011-06-20 Thread Mark Thomas
Getting back to this. Comments in-line.

On 23/05/2011 22:01, Konstantin Kolinko wrote:
 2011/5/20 Mark Thomas ma...@apache.org:
 All,

 I've been looking at [1]. Ignoring the flames, there do appear to be
 several use cases where the current time-stamp checks are insufficient
 (although there are simple work-arounds). I have a patch [2] but I don't
 particularly like the fact that it breaks binary compatibility with JSPs
 compiled with an earlier version. My instinct is that this is bad. What
 does everyone else think?

 I do have an idea for addressing this:
 - Leave JspSourceDependent as is in 7.0.14 but deprecate it
 - Add a new JspSourceDependent2 interface (better names welcome)
 - Compilation always uses JspSourceDependent2
 - Isoutdated checked for JspSourceDependent as well as
 JspSourceDependent2 and any classes implementing JspSourceDependent are
 treated as outdated.

 Thoughts?

 Mark

 [1] https://issues.apache.org/bugzilla/show_bug.cgi?id=33453
 [2] https://issues.apache.org/bugzilla/attachment.cgi?id=27040action=diff

 
 Looking at the patch [2] what strikes me more is the new feature of
 using setLastModified(jspLastModified); to set the timestamp of the
 java and class files to match the original jsp(x)/tag(x) file.
 
 It looks like a clever trick, but I am a bit afraid of it. It is a bit
 counter-intuitive why timestamp can be earlier than max(timestamps of
 dependencies).

Hence the comment in the generated code. There was a comment on the bug
report that at least one other app server does this. Suggestions on what
else we can do welcome.

 If you use JspC to generate Java files for the pages and then have a
 separate step to compile it you will notice, that javac task of Ant
 [3] does not have preservelastmodified property, unlike the copy
 task.

I'm not concerned about JspC since there is never a dependency check for
recompilation in that case.

 Not all war-file extract operations in Tomcat set lastmodifiedtime on
 a file. This should be fixable though.  Searching for
 FileOutputStream
 +  ExpandWar.expand() does set the time.
 -  WebappClassLoader.findResourceInternal(String, String) has if
 (antiJARLocking) branch. It extracts resource files but does not set
 lastmodifiedtime. I suspect that it may impact tag files in jars.

Agreed. I'll include a fix for this in the patch.

 - WebappLoader.copyDir(DirContext, File) does not set the time.  IIRC
 this happens when unpackWARs=false, though I do not see it straight
 from the code.

It looks to me like that only extracts files from the classes directory.
I didn't look into why it does that, but it won't affect JSP compilation.

 Regarding the question in the original e-mail regarding the interface
 my thoughts are:
 Tim's suggestion looks like a better one.

I went with a variation of this. The change to using != rather than 
means that most JSPs / tag files will get recompiled on first access
anyway. I forced my way past that with the debugger and saw that an
AbstractMethodError is thrown. I can catch that and return something
that forces a recompilation.

 Finally some small nitpicks regarding the patch [2] itself.
 1) I wonder whether this is OK to change JspCompilationContext class
 in this way. I think we usually add methods, but do not remove them.

The release notes make clear that the internal API is subject to change
between point releases.

That said, keeping the original method and marking it as deprecated
won't do any harm so I'll do that.

We can't handle down-grades as easily, so I'll make sure that change log
includes a note on this.

 2) In JspCompilationContext line 298 the change is
 s/jar:file:/jar:jndi:/.  It might be needed, but I do not
 understand why. It looks like a separate (un)related issue.

Sort of. Fixed separately.

 3) Typo in generated comment in Generator.java,  s/to assit/to assist/

Thanks. Fixed.

Commit coming soon once I have finished some more testing.

Mark



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



svn commit: r1137725 - in /tomcat/trunk: java/org/apache/catalina/loader/ java/org/apache/jasper/ java/org/apache/jasper/compiler/ java/org/apache/jasper/runtime/ java/org/apache/jasper/servlet/ webap

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 18:02:25 2011
New Revision: 1137725

URL: http://svn.apache.org/viewvc?rev=1137725view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=33453
Recompile JSPs if last modified time of the source or any of its dependencies 
changes either forwards or backwards. Note that this introduces an incompatible 
change to the code generated for JSPs. Tomcat will automatically re-compile any 
JSPs and tag files found in the work directory when upgrading from 7.0.16 or 
earlier to 7.0.17 or later. If you later downgrade from 7.0.17 or later to 
7.0.16 or earlier, you must empty the work directory as part of the downgrade 
process.

Modified:
tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java
tomcat/trunk/java/org/apache/jasper/compiler/Generator.java
tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java
tomcat/trunk/java/org/apache/jasper/compiler/PageInfo.java
tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java
tomcat/trunk/java/org/apache/jasper/compiler/TagFileProcessor.java
tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java
tomcat/trunk/java/org/apache/jasper/runtime/JspSourceDependent.java
tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1137725r1=1137724r2=1137725view=diff
==
--- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Mon Jun 
20 18:02:25 2011
@@ -3025,6 +3025,8 @@ public class WebappClassLoader
 }
 os.write(buf, 0, n);
 }
+resourceFile.setLastModified(
+jarEntry2.getTime());
 } catch (IOException e) {
 // Ignore
 } finally {

Modified: tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java?rev=1137725r1=1137724r2=1137725view=diff
==
--- tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java (original)
+++ tomcat/trunk/java/org/apache/jasper/JspCompilationContext.java Mon Jun 20 
18:02:25 2011
@@ -385,6 +385,11 @@ public class JspCompilationContext {
 return jspUri;
 }
 
+/**
+ * @deprecated Will be removed in Tomcat 8.0.x. Use
+ * {@link #getLastModified(String)} instead.
+ */
+@Deprecated
 public long getJspLastModified() {
 long result = -1;
 URLConnection uc = null;
@@ -422,6 +427,44 @@ public class JspCompilationContext {
 return result;
 }
 
+
+public Long getLastModified(String resource) {
+long result = -1;
+URLConnection uc = null;
+try {
+URL jspUrl = getResource(resource);
+if (jspUrl == null) {
+incrementRemoved();
+return Long.valueOf(result);
+}
+uc = jspUrl.openConnection();
+if (uc instanceof JarURLConnection) {
+result = ((JarURLConnection) uc).getJarEntry().getTime();
+} else {
+result = uc.getLastModified();
+}
+} catch (IOException e) {
+if (log.isDebugEnabled()) {
+log.debug(Localizer.getMessage(
+jsp.error.lastModified, getJspFile()), e);
+}
+result = -1;
+} finally {
+if (uc != null) {
+try {
+uc.getInputStream().close();
+} catch (IOException e) {
+if (log.isDebugEnabled()) {
+log.debug(Localizer.getMessage(
+jsp.error.lastModified, getJspFile()), e);
+}
+result = -1;
+}
+}
+}
+return Long.valueOf(result);
+}
+
 public boolean isTagFile() {
 return isTagFile;
 }

Modified: tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Compiler.java?rev=1137725r1=1137724r2=1137725view=diff

DO NOT REPLY [Bug 33453] Jasper should recompile JSP files whose datestamps change in either direction (not just newer)

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=33453

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #69 from Mark Thomas ma...@apache.org 2011-06-20 18:03:09 UTC ---
This has been fixed in 7.0.x and will be included in 7.0.17 onwards.

The fix was fairly invasive so it will not be back-ported to 6.0.x or 5.5.x.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



Re: OneLineFormatter by default?

2011-06-20 Thread Rainer Jung
Thanks Konstantin. I'll take a look at cleaning up 1) to 3), likely
using the DateFormatCache from the AccessLogValve as a utility class.

Regards,

Rainer

On 20.06.2011 18:52, Konstantin Kolinko wrote:
 2011/6/20 Rainer Jung rainer.j...@kippdata.de:
 Should we use the new OneLineFormatter as the default juli formatter?

 I never found anyone who liked the default java.util.logging log format,
 which spreads all messages out via two lines. One line contains the
 timestamp, the other line the message.

 So if your grep for a message, you want find out when it was issued, and
 if you look for a certain time range, yout wont see the actual messages.
 Non-sense.

 Now that we have our nice little OneLineFormatter, why not use it as
 default?

 
 I like the default SimpleFormatter. With the SimpleFormatter those
 messages fit better when they are printed into console window. It is
 easier to read through the log files as well.
 
 With OneLineFormatter the messages are shifted to the right. The
 offset is arbitrary, because class names before the message have
 arbitrary length. Enabling line wrapping in file viewer is possible,
 but does not make those lines more readable. It is hard to read.
 
 I think SimpleFormatter should stay as the default.
 
 
 Some nitpicks looking at the source code of OneLineFormatter.
 
 1) OneLineFormatter#currentDate and currentDateString are used in
 double locking. If I understand it correctly, the should be made
 volatile. Though see the next point.
 
 2) I do not understand why OneLineFormatter#addTimestamp( ) method is public.
 
 It could be protected. It is not used anywhere else. Furthermore, the
 only place where it is called, the #format() method,  always creates a
 new instance of Date object.  Thus if (currentDate != date)
 comparison of object instances does not make sense.
 
 3) msec value looses its leading zero. E.g. in two subsequent lines:
 
 20-Jun-2011 20:25:25.46
 20-Jun-2011 20:25:25.531
 
 4) SimpleFormatter#format() delegates message formatting to
 Formatter#formatMessage(..) which performs lookup through a resource
 bundle and does formatting of parameters.
 
 OneLineFormatter does not do it. It just uses the message as String.
 It is not of much difference for Tomcat, because Tomcat does not use
 java.util.logging directly, but some other webapps may use it.
 (Not a very strong argument though).
 
 If we use it as default: should be have it as default without config,
 i.e. as a default in code, or do we want to add the .formatter lines to
 our loggging.properties? Or add the formatter system property to
 catalina.properties?

 I think I would favor having it as a code default, i.e. without any
 configuration.

 
 In the code you can change default for the JULI's FileHandler only.
 (Unless you tweak properties loading itself).  There are other Handler
 implementations there.
 
 If it were changed I'd prefer it to be in the configuration.
 
 
 Regarding grep:
 Some grep implementations (e.g. the GNU one) have
  --context, --before-context, --after-context options to print several lines
 of context for each match
 (section 2.1.5 in [1]).
 
 [1]: http://www.gnu.org/software/grep/manual/
 
 Best regards,
 Konstantin Kolinko

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



Re: OneLineFormatter by default?

2011-06-20 Thread Mark Thomas
On 20/06/2011 19:07, Rainer Jung wrote:
 Thanks Konstantin. I'll take a look at cleaning up 1) to 3), likely
 using the DateFormatCache from the AccessLogValve as a utility class.

Already on it. Note DateFormatCache can't be used because a) JULI can't
depend on Catalina and b) the AccessLog timestamps are accurate to the
nearest second whereas the logging timestamps use ms.

Mark

 
 Regards,
 
 Rainer
 
 On 20.06.2011 18:52, Konstantin Kolinko wrote:
 2011/6/20 Rainer Jung rainer.j...@kippdata.de:
 Should we use the new OneLineFormatter as the default juli formatter?

 I never found anyone who liked the default java.util.logging log format,
 which spreads all messages out via two lines. One line contains the
 timestamp, the other line the message.

 So if your grep for a message, you want find out when it was issued, and
 if you look for a certain time range, yout wont see the actual messages.
 Non-sense.

 Now that we have our nice little OneLineFormatter, why not use it as
 default?


 I like the default SimpleFormatter. With the SimpleFormatter those
 messages fit better when they are printed into console window. It is
 easier to read through the log files as well.

 With OneLineFormatter the messages are shifted to the right. The
 offset is arbitrary, because class names before the message have
 arbitrary length. Enabling line wrapping in file viewer is possible,
 but does not make those lines more readable. It is hard to read.

 I think SimpleFormatter should stay as the default.


 Some nitpicks looking at the source code of OneLineFormatter.

 1) OneLineFormatter#currentDate and currentDateString are used in
 double locking. If I understand it correctly, the should be made
 volatile. Though see the next point.

 2) I do not understand why OneLineFormatter#addTimestamp( ) method is public.

 It could be protected. It is not used anywhere else. Furthermore, the
 only place where it is called, the #format() method,  always creates a
 new instance of Date object.  Thus if (currentDate != date)
 comparison of object instances does not make sense.

 3) msec value looses its leading zero. E.g. in two subsequent lines:

 20-Jun-2011 20:25:25.46
 20-Jun-2011 20:25:25.531

 4) SimpleFormatter#format() delegates message formatting to
 Formatter#formatMessage(..) which performs lookup through a resource
 bundle and does formatting of parameters.

 OneLineFormatter does not do it. It just uses the message as String.
 It is not of much difference for Tomcat, because Tomcat does not use
 java.util.logging directly, but some other webapps may use it.
 (Not a very strong argument though).

 If we use it as default: should be have it as default without config,
 i.e. as a default in code, or do we want to add the .formatter lines to
 our loggging.properties? Or add the formatter system property to
 catalina.properties?

 I think I would favor having it as a code default, i.e. without any
 configuration.


 In the code you can change default for the JULI's FileHandler only.
 (Unless you tweak properties loading itself).  There are other Handler
 implementations there.

 If it were changed I'd prefer it to be in the configuration.


 Regarding grep:
 Some grep implementations (e.g. the GNU one) have
  --context, --before-context, --after-context options to print several lines
 of context for each match
 (section 2.1.5 in [1]).

 [1]: http://www.gnu.org/software/grep/manual/

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




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



svn commit: r1137731 - in /tomcat/trunk: java/org/apache/juli/OneLineFormatter.java webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 18:19:08 2011
New Revision: 1137731

URL: http://svn.apache.org/viewvc?rev=1137731view=rev
Log:
Address kkolinko's review comments

Modified:
tomcat/trunk/java/org/apache/juli/OneLineFormatter.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/juli/OneLineFormatter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/OneLineFormatter.java?rev=1137731r1=1137730r2=1137731view=diff
==
--- tomcat/trunk/java/org/apache/juli/OneLineFormatter.java (original)
+++ tomcat/trunk/java/org/apache/juli/OneLineFormatter.java Mon Jun 20 18:19:08 
2011
@@ -47,10 +47,10 @@ public class OneLineFormatter extends Fo
 private final SimpleDateFormat monthFormatter = new SimpleDateFormat(MM);
 private final SimpleDateFormat yearFormatter = new 
SimpleDateFormat();
 private final SimpleDateFormat timeFormatter =
-new SimpleDateFormat(HH:mm:ss.S);
+new SimpleDateFormat(HH:mm:ss.SSS);
 
-private Date currentDate;
-private String currentDateString;
+private volatile Date currentDate;
+private volatile String currentDateString;
 
 @Override
 public String format(LogRecord record) {
@@ -71,7 +71,7 @@ public class OneLineFormatter extends Fo
 
 // Message
 sb.append(' ');
-sb.append(record.getMessage());
+sb.append(formatMessage(record));
 
 // Stack trace
 if (record.getThrown() != null) {
@@ -89,10 +89,10 @@ public class OneLineFormatter extends Fo
 return sb.toString();
 }
 
-public void addTimestamp(StringBuilder buf, Date date) {
-if (currentDate != date) {
+protected void addTimestamp(StringBuilder buf, Date date) {
+if (currentDate.getTime() != date.getTime()) {
 synchronized (this) {
-if (currentDate != date) {
+if (currentDate.getTime() != date.getTime()) {
 StringBuilder current = new StringBuilder(32);
 current.append(dayFormatter.format(date)); // Day
 current.append('-');

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137731r1=1137730r2=1137731view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 18:19:08 2011
@@ -78,6 +78,13 @@
 when Tomcat was shutdown. This fix ensures that that work directory for
 an application is not deleted when Tomcat is shutdown. (mark)
   /fix
+  fix
+Correct issues with JULIapos;s OneLineFormatter including: correctly
+re-using formatted timestamps when possible; thread-safety issues in
+tiomstamp formatting; correcting the output of any milliseconds to
+include leading zeros and formatting any parameters present.
+(kolinko/markt)
+  /fix
 /changelog
   /subsection
   subsection name=Coyote



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



Re: OneLineFormatter by default?

2011-06-20 Thread Rainer Jung
On 20.06.2011 20:10, Mark Thomas wrote:
 On 20/06/2011 19:07, Rainer Jung wrote:
 Thanks Konstantin. I'll take a look at cleaning up 1) to 3), likely
 using the DateFormatCache from the AccessLogValve as a utility class.
 
 Already on it. Note DateFormatCache can't be used because a) JULI can't
 depend on Catalina and b) the AccessLog timestamps are accurate to the
 nearest second whereas the logging timestamps use ms.

Sorry for not having answered quicker:

- you can use DateFormatCache like in the AccessLogValve: cachig is most
efficient if done on a per second basis. Adding the milliseconds after
the cached format is trivial and can be done after retrieving the format.

- Yup, I have a variant ready, that copied a small DateFormatCache class
into juli.

I can post the patch in a few minutes, just want to test first.

Regards,

Rainer

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



svn commit: r1137746 - /tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 19:01:14 2011
New Revision: 1137746

URL: http://svn.apache.org/viewvc?rev=1137746view=rev
Log:
Remove unused code.

Modified:
tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java

Modified: tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java?rev=1137746r1=1137745r2=1137746view=diff
==
--- tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java (original)
+++ tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java Mon Jun 20 
19:01:14 2011
@@ -155,14 +155,6 @@ public class AccessLogValve extends Valv
 
 
 /**
- * The set of month abbreviations for log messages.
- */
-protected static final String months[] =
-{ Jan, Feb, Mar, Apr, May, Jun,
-  Jul, Aug, Sep, Oct, Nov, Dec };
-
-
-/**
  * enabled this component
  */
 protected boolean enabled = true;
@@ -908,24 +900,6 @@ public class AccessLogValve extends Valv
 
 
 /**
- * Return the month abbreviation for the specified month, which must
- * be a two-digit String.
- *
- * @param month Month number (01 .. 12).
- */
-private static String lookup(String month) {
-int index;
-try {
-index = Integer.parseInt(month) - 1;
-} catch (Throwable t) {
-ExceptionUtils.handleThrowable(t);
-index = 0;  // Can not happen, in theory
-}
-return (months[index]);
-}
-
-
-/**
  * Open the new log file for the date specified by codedateStamp/code.
  */
 protected synchronized void open() {



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



Re: OneLineFormatter by default?

2011-06-20 Thread Christopher Schultz
Mark,

On 6/20/2011 10:54 AM, Mark Thomas wrote:
 On 20/06/2011 15:51, Rainer Jung wrote:
 Should we use the new OneLineFormatter as the default juli formatter?

 I never found anyone who liked the default java.util.logging log format,
 which spreads all messages out via two lines. One line contains the
 timestamp, the other line the message.

 So if your grep for a message, you want find out when it was issued, and
 if you look for a certain time range, yout wont see the actual messages.
 Non-sense.

 Now that we have our nice little OneLineFormatter, why not use it as
 default?

 If we use it as default: should be have it as default without config,
 i.e. as a default in code, or do we want to add the .formatter lines to
 our loggging.properties? Or add the formatter system property to
 catalina.properties?

 I think I would favor having it as a code default, i.e. without any
 configuration.
 
 That might be a surprise for users.

+1

Though I also hate the timestamp\nmessage format, too, enough people
probably rely on it to seriously break things.

 I'd lean towards make it the default via config (very easy to revert)
 and change the code default for 8.x onwards.

+1

-chris



signature.asc
Description: OpenPGP digital signature


Re: OneLineFormatter by default?

2011-06-20 Thread Mark Thomas
On 20/06/2011 19:55, Rainer Jung wrote:
 On 20.06.2011 20:10, Mark Thomas wrote:
 On 20/06/2011 19:07, Rainer Jung wrote:
 Thanks Konstantin. I'll take a look at cleaning up 1) to 3), likely
 using the DateFormatCache from the AccessLogValve as a utility class.

 Already on it. Note DateFormatCache can't be used because a) JULI can't
 depend on Catalina and b) the AccessLog timestamps are accurate to the
 nearest second whereas the logging timestamps use ms.
 
 Sorry for not having answered quicker:
 
 - you can use DateFormatCache like in the AccessLogValve: cachig is most
 efficient if done on a per second basis. Adding the milliseconds after
 the cached format is trivial and can be done after retrieving the format.
 
 - Yup, I have a variant ready, that copied a small DateFormatCache class
 into juli.
 
 I can post the patch in a few minutes, just want to test first.

Have at it :)

Mark



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



Re: svn commit: r1137731 - in /tomcat/trunk: java/org/apache/juli/OneLineFormatter.java webapps/docs/changelog.xml

2011-06-20 Thread Rainer Jung
A version using the DateFormatCache is available at:

http://people.apache.org/~rjung/patches/OneLineFormatter-DateFormatCache.patch

Regards,

Rainer

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



Re: svn commit: r1137731 - in /tomcat/trunk: java/org/apache/juli/OneLineFormatter.java webapps/docs/changelog.xml

2011-06-20 Thread Mark Thomas
On 20/06/2011 20:15, Rainer Jung wrote:
 A version using the DateFormatCache is available at:
 
 http://people.apache.org/~rjung/patches/OneLineFormatter-DateFormatCache.patch

If it works, why not commit it ;)

Mark



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



REMINDER: Participation Requested: Survey about Open-Source Software Development

2011-06-20 Thread Jeffrey Carver
Hi,

Apologies for any inconvenience and thank you to those who have already
completed the survey. We will keep the survey open for another couple of
weeks. But, we do hope you will consider responding to the email request
below (sent 2 weeks ago).

Thanks,

Dr. Jeffrey Carver
Assistant Professor
University of Alabama
(v) 205-348-9829  (f) 205-348-0219
http://www.cs.ua.edu/~carver

-Original Message-
From: Jeffrey Carver [mailto:opensourcesur...@cs.ua.edu] 
Sent: Monday, June 13, 2011 11:23 AM
To: 'dev@tomcat.apache.org'
Subject: Participation Requested: Survey about Open-Source Software
Development

Hi,

Drs. Jeffrey Carver, Rosanna Guadagno, Debra McCallum, and Mr. Amiangshu
Bosu,  University of Alabama, and Dr. Lorin Hochstein, University of
Southern California, are conducting a survey of open-source software
developers. This survey seeks to understand how developers on distributed,
virtual teams, like open-source projects, interact with each other to
accomplish their tasks. You must be at least 19 years of age to complete the
survey. The survey should take approximately 15 minutes to complete.

If you are actively participating as a developer, please consider completing
our survey.
 
Here is the link to the survey:   http://goo.gl/HQnux

We apologize for inconvenience and if you receive multiple copies of this
email. This survey has been approved by The University of Alabama IRB board.

Thanks,

Dr. Jeffrey Carver
Assistant Professor
University of Alabama
(v) 205-348-9829  (f) 205-348-0219
http://www.cs.ua.edu/~carver


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



DO NOT REPLY [Bug 51395] First application that loads SAXParserFactory causes Class loader memory leak

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51395

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED

--- Comment #3 from Mark Thomas ma...@apache.org 2011-06-20 19:27:43 UTC ---
Thanks for the report. This has been fixed in 7.0.x and will be included in
7.0.17 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137753 - in /tomcat/trunk: java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 19:26:45 2011
New Revision: 1137753

URL: http://svn.apache.org/viewvc?rev=1137753view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51395
Fix memory leak triggered when an application that includes a SAXParserFactory 
is the first web application to be loaded.

Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1137753r1=1137752r2=1137753view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Jun 20 
19:26:45 2011
@@ -229,6 +229,32 @@ public class ContextConfig
 new LoginConfig(NONE, null, null, null);
 
 
+static {
+webDigesters[0] = DigesterFactory.newDigester(false, false, 
webRuleSet);
+webDigesters[0].getParser();
+webFragmentDigesters[0] = DigesterFactory.newDigester(false, false,
+webFragmentRuleSet);
+webFragmentDigesters[0].getParser();
+
+webDigesters[1] = DigesterFactory.newDigester(true, false, webRuleSet);
+webDigesters[1].getParser();
+webFragmentDigesters[1] = DigesterFactory.newDigester(true, false,
+webFragmentRuleSet);
+webFragmentDigesters[1].getParser();
+
+webDigesters[2] = DigesterFactory.newDigester(false, true, webRuleSet);
+webDigesters[2].getParser();
+webFragmentDigesters[2] = DigesterFactory.newDigester(false, true,
+webFragmentRuleSet);
+webFragmentDigesters[2].getParser();
+
+webDigesters[3] = DigesterFactory.newDigester(true, true, webRuleSet);
+webDigesters[3].getParser();
+webFragmentDigesters[3] = DigesterFactory.newDigester(true, true,
+webFragmentRuleSet);
+webFragmentDigesters[3].getParser();
+}
+
 // - Properties
 
 
@@ -475,46 +501,22 @@ public class ContextConfig
  * Create (if necessary) and return a Digester configured to process the
  * web application deployment descriptor (web.xml).
  */
-public void createWebXmlDigester(boolean namespaceAware,
+protected void createWebXmlDigester(boolean namespaceAware,
 boolean validation) {
 
 if (!namespaceAware  !validation) {
-if (webDigesters[0] == null) {
-webDigesters[0] = DigesterFactory.newDigester(validation,
-namespaceAware, webRuleSet);
-webFragmentDigesters[0] = 
DigesterFactory.newDigester(validation,
-namespaceAware, webFragmentRuleSet);
-}
 webDigester = webDigesters[0];
 webFragmentDigester = webFragmentDigesters[0];
 
 } else if (!namespaceAware  validation) {
-if (webDigesters[1] == null) {
-webDigesters[1] = DigesterFactory.newDigester(validation,
-namespaceAware, webRuleSet);
-webFragmentDigesters[1] = 
DigesterFactory.newDigester(validation,
-namespaceAware, webFragmentRuleSet);
-}
 webDigester = webDigesters[1];
 webFragmentDigester = webFragmentDigesters[1];
 
 } else if (namespaceAware  !validation) {
-if (webDigesters[2] == null) {
-webDigesters[2] = DigesterFactory.newDigester(validation,
-namespaceAware, webRuleSet);
-webFragmentDigesters[2] = 
DigesterFactory.newDigester(validation,
-namespaceAware, webFragmentRuleSet);
-}
 webDigester = webDigesters[2];
 webFragmentDigester = webFragmentDigesters[2];
 
 } else {
-if (webDigesters[3] == null) {
-webDigesters[3] = DigesterFactory.newDigester(validation,
-namespaceAware, webRuleSet);
-webFragmentDigesters[3] = 
DigesterFactory.newDigester(validation,
-namespaceAware, webFragmentRuleSet);
-}
 webDigester = webDigesters[3];
 webFragmentDigester = webFragmentDigesters[3];
 }

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137753r1=1137752r2=1137753view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 19:26:45 2011
@@ -85,6 +85,11 @@
 

DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #3 from bmargulies bimargul...@gmail.com 2011-06-20 19:36:14 UTC 
---
Since bz won't let me edit, I will improve on my description down here.

1) I've written a class that uses the embedded API:

  org.apache.catalina.startup.Tomcat

2) My class calls Tomcat.addWebapp.

3) My class works fine on a webapp that contains JSP pages.

4) My class does NOT work for webapps that have servlet declarations that
name jsp pages.

5) The reason, which I have diagnosed, is the lack of the following servlet
declaration from the default web.xml:

 servlet
servlet-namejsp/servlet-name
servlet-classorg.apache.jasper.servlet.JspServlet/servlet-class
init-param
param-namefork/param-name
param-valuefalse/param-value
/init-param
init-param
param-namexpoweredBy/param-name
param-valuefalse/param-value
/init-param
load-on-startup3/load-on-startup
/servlet

6) Tomcat.addWebapp does extra work to prevent the use of the default web.xml.

7) I can't find any test case in the tomcat hierarchy that looks like this
overall model, and in particular which supplies default web.xml content when
using the embedded Tomcat class. Though I may of course be missing something.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137754 - in /tomcat/trunk: conf/catalina.properties test/org/apache/catalina/startup/TomcatBaseTest.java webapps/docs/changelog.xml

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 19:44:04 2011
New Revision: 1137754

URL: http://svn.apache.org/viewvc?rev=1137754view=rev
Log:
More Jars to skip: ant-junit and Java Help.

Modified:
tomcat/trunk/conf/catalina.properties
tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/conf/catalina.properties
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/conf/catalina.properties?rev=1137754r1=1137753r2=1137754view=diff
==
--- tomcat/trunk/conf/catalina.properties (original)
+++ tomcat/trunk/conf/catalina.properties Mon Jun 20 19:44:04 2011
@@ -99,11 +99,11 @@ commons-httpclient*.jar,commons-io*.jar,
 commons-math*.jar,commons-pool*.jar,\
 jstl.jar,\
 geronimo-spec-jaxrpc*.jar,wsdl4j*.jar,\
-ant.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\
+ant.jar,ant-junit*.jar,aspectj*.jar,jmx.jar,h2*.jar,hibernate*.jar,httpclient*.jar,\
 jmx-tools.jar,jta*.jar,log4j*.jar,mail*.jar,slf4j*.jar,\
 xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
 dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunmscapi.jar,\
-sunpkcs11.jar,tools.jar,\
+sunpkcs11.jar,jhall.jar,tools.jar,\
 apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
 j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
 mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar

Modified: tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java?rev=1137754r1=1137753r2=1137754view=diff
==
--- tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java (original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TomcatBaseTest.java Mon Jun 
20 19:44:04 2011
@@ -116,17 +116,18 @@ public abstract class TomcatBaseTest ext
 tomcat-dbcp.jar, +
 tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar, +
 tomcat-i18n-ja.jar, +
+
tomcat-juli-adapters.jar,catalina-jmx-remote.jar,catalina-ws.jar, +
 commons-beanutils*.jar,commons-collections*.jar, +
 commons-dbcp*.jar,commons-digester*.jar, +
 commons-fileupload*.jar,commons-io*.jar, +
 commons-logging*.jar,commons-math*.jar,commons-pool*.jar, +
 jstl.jar, +
 geronimo-spec-jaxrpc*.jar,wsdl4j*.jar, +
-ant.jar,jmx.jar,hibernate*.jar,jmx-tools.jar,jta*.jar, +
+
ant.jar,ant-junit*.jar,jmx.jar,hibernate*.jar,jmx-tools.jar,jta*.jar, +
 log4j*.jar,slf4j*.jar +
 xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar, +
 dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar, +
-sunpkcs11.jar,tools.jar, +
+sunpkcs11.jar,jhall.jar,tools.jar, +
 apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar, +
 dns_sd.jar,j3daudio.jar,j3dcore.jar,j3dutils.jar, +
 jai_core.jar,jai_codec.jar, +

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137754r1=1137753r2=1137754view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 19:44:04 2011
@@ -69,8 +69,8 @@
 in AccessLogValve. Support logging begin and/or end of request. (rjung)
   /add
   update
-Add the Tomcat extras JARs to the list of JARs to skip when scanning
-for TLDs and web fragments. (rjung)
+Add the Tomcat extras, ant-junit and Java Help Jars to the list of JARs
+to skip when scanning for TLDs and web fragments. (rjung)
   /update
   fix
 The fix for bug bug51310/bug caused a regression that re-introduced



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



svn commit: r1137758 - in /tomcat/trunk: java/org/apache/juli/DateFormatCache.java java/org/apache/juli/OneLineFormatter.java webapps/docs/changelog.xml

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 19:47:57 2011
New Revision: 1137758

URL: http://svn.apache.org/viewvc?rev=1137758view=rev
Log:
Let OneLineFormatter use DateFormatCache.

Added:
tomcat/trunk/java/org/apache/juli/DateFormatCache.java   (with props)
Modified:
tomcat/trunk/java/org/apache/juli/OneLineFormatter.java
tomcat/trunk/webapps/docs/changelog.xml

Added: tomcat/trunk/java/org/apache/juli/DateFormatCache.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/DateFormatCache.java?rev=1137758view=auto
==
--- tomcat/trunk/java/org/apache/juli/DateFormatCache.java (added)
+++ tomcat/trunk/java/org/apache/juli/DateFormatCache.java Mon Jun 20 19:47:57 
2011
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the License); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+package org.apache.juli;
+
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+
+/**
+ * pCache structure for formatted timestamps based on seconds./p
+ *
+ * pThe cache consists of entries for a consecutive range of
+ * seconds. The length of the range is configurable. It is
+ * implemented based on a cyclic buffer. New entries shift the range./p
+ *
+ * pThe cache is not threadsafe. It can be used without synchronization
+ * via thread local instances, or with synchronization as a global cache./p
+ *
+ * @version $Id$
+ */
+
+public class DateFormatCache {
+
+/* Timestamp format */
+private final String format;
+
+/* Number of cached entries */
+private int cacheSize = 0;
+
+private DateFormatCache parent;
+private Cache cache;
+
+/* Cache type, parent or child */
+private String type;
+
+public DateFormatCache(int size, String format, DateFormatCache parent) {
+if (parent == null) {
+type = main;
+} else {
+type = child;
+}
+cacheSize = size;
+this.format = format;
+this.parent = parent;
+Cache parentCache = null;
+if (parent != null) {
+synchronized(parent) {
+parentCache = parent.cache;
+}
+}
+cache = new Cache(parentCache);
+}
+
+public String getFormat(long time) {
+return cache.getFormat(time);
+}
+
+private class Cache {
+
+/* Second formatted in most recent invocation */
+private long previousSeconds = 0L;
+/* Formatted timestamp generated in most recent invocation */
+private String previousFormat = ;
+
+/* First second contained in cache */
+private long first = 0L;
+/* Last second contained in cache */
+private long last = 0L;
+/* Index of first in the cyclic cache */
+private int offset = 0;
+/* Helper object to be able to call SimpleDateFormat.format(). */
+private final Date currentDate = new Date();
+
+private String cache[];
+private SimpleDateFormat formatter;
+
+private Cache parent = null;
+
+private Cache(Cache parent) {
+cache = new String[cacheSize];
+for (int i = 0; i  cacheSize; i++) {
+cache[i] = null;
+}
+formatter = new SimpleDateFormat(format);
+formatter.setTimeZone(TimeZone.getDefault());
+this.parent = parent;
+}
+
+private String getFormat(long time) {
+
+long seconds = time / 1000;
+
+/* First step: if we have seen this timestamp
+   during the previous call, return the previous value. */
+if (seconds == previousSeconds) {
+return previousFormat;
+}
+
+/* Second step: Try to locate in cache */
+previousSeconds = seconds;
+int index = (offset + (int)(seconds - first)) % cacheSize;
+if (index  0) {
+index += cacheSize;
+}
+if (seconds = first  seconds = last) {
+if (cache[index] != null) {
+/* Found, so remember for next call and return.*/
+previousFormat = cache[index];
+return previousFormat;

DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #4 from bmargulies bimargul...@gmail.com 2011-06-20 19:51:00 UTC 
---
In short, if there is a defect here, it is that:

org.apache.catalina.startup.Tomcat.initWebappDefaults(Context)

does not set up the servlet named 'jsp' which is set up in the default web.xml,
and that the modularity of the Tomcat class does not offer a straightforward
way to change that, since the function is static and so cannot be trivially
@overridden.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137762 - /tomcat/trunk/java/org/apache/juli/DateFormatCache.java

2011-06-20 Thread rjung
Author: rjung
Date: Mon Jun 20 20:12:26 2011
New Revision: 1137762

URL: http://svn.apache.org/viewvc?rev=1137762view=rev
Log:
Make sure we never use the DateFormatCache with
millisecond patterns.

Tidy the format pattern like we do in the
AccessLogValve.

Modified:
tomcat/trunk/java/org/apache/juli/DateFormatCache.java

Modified: tomcat/trunk/java/org/apache/juli/DateFormatCache.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/DateFormatCache.java?rev=1137762r1=1137761r2=1137762view=diff
==
--- tomcat/trunk/java/org/apache/juli/DateFormatCache.java (original)
+++ tomcat/trunk/java/org/apache/juli/DateFormatCache.java Mon Jun 20 20:12:26 
2011
@@ -24,7 +24,11 @@ import java.util.Date;
 import java.util.TimeZone;
 
 /**
- * pCache structure for formatted timestamps based on seconds./p
+ * pCache structure for SimpleDateFormat formatted timestamps based on
+ * seconds./p
+ *
+ * pMillisecond formatting using S is not supported. You should add the
+ * millisecond information after getting back the second formatting./p
  *
  * pThe cache consists of entries for a consecutive range of
  * seconds. The length of the range is configurable. It is
@@ -38,6 +42,8 @@ import java.util.TimeZone;
 
 public class DateFormatCache {
 
+private static final String msecPattern = #;
+
 /* Timestamp format */
 private final String format;
 
@@ -50,6 +56,32 @@ public class DateFormatCache {
 /* Cache type, parent or child */
 private String type;
 
+/**
+ * Replace the millisecond formatting character 'S' by
+ * some dummy characters in order to make the resulting
+ * formatted time stamps cacheable. Our consumer might
+ * choose to replace the dummies with the actual milliseconds
+ * because that's relatively cheap.
+ */
+private String tidyFormat(String format) {
+boolean escape = false;
+StringBuilder result = new StringBuilder();
+int len = format.length();
+char x;
+for (int i = 0; i  len; i++) {
+x = format.charAt(i);
+if (escape || x != 'S') {
+result.append(x);
+} else {
+result.append(msecPattern);
+}
+if (x == '\'') {
+escape = !escape;
+}
+}
+return result.toString();
+}
+
 public DateFormatCache(int size, String format, DateFormatCache parent) {
 if (parent == null) {
 type = main;
@@ -57,7 +89,7 @@ public class DateFormatCache {
 type = child;
 }
 cacheSize = size;
-this.format = format;
+this.format = tidyFormat(format);
 this.parent = parent;
 Cache parentCache = null;
 if (parent != null) {



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



svn commit: r1137764 - /tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 20:20:27 2011
New Revision: 1137764

URL: http://svn.apache.org/viewvc?rev=1137764view=rev
Log:
Fix odd looking code

Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1137764r1=1137763r2=1137764view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Jun 20 
20:20:27 2011
@@ -1307,7 +1307,7 @@ public class ContextConfig
 webXml.merge(defaults);
 
 // Step 8. Convert explicitly mentioned jsps to servlets
-if (!false) {
+if (ok) {
 convertJsps(webXml);
 }
 



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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #5 from bmargulies bimargul...@gmail.com 2011-06-20 22:09:07 UTC 
---
Created attachment 27182
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27182
test case in a patch

Here is a minimal test case as a patch. Proposed fix to follow.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #6 from Mark Thomas ma...@apache.org 2011-06-20 22:11:25 UTC ---
Bugs opened shortly after almost identical reports on the users list and
containing statements that are clearly wrong (the jsp servlet is defined) do
tend to get closed as invalid quickly to keep the noise down.

There is a bug here but a simpler test case would have made tracking it down a
lot easier.

org.apache.catalina.startup.Tomcat.initWebappDefaults(Context) is a red
herring. That code is fine. The problem is around where the NPE occurs. Because
the JSP has been set up programmatically, the definition of the init parameters
isn't where it would be if read from the default web.xml and that triggers the
NPE.

I have a fix and the test case gets to the point where the app starts but I get
500 errors and the message java.lang.RuntimeException: Can't find resource
'solrconfig.xml' in classpath or 'D:\solr_webapp\.\conf/. I don't see a file
with that name in testcase.

I'll commit that fix shortly and I'm going to assume that the 500 error is a
problem with the webapp rather than another bug.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137803 - /tomcat/trunk/webapps/docs/changelog.xml

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 22:28:57 2011
New Revision: 1137803

URL: http://svn.apache.org/viewvc?rev=1137803view=rev
Log:
Ordering

Modified:
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/webapps/docs/changelog.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1137803r1=1137802r2=1137803view=diff
==
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Mon Jun 20 22:28:57 2011
@@ -49,6 +49,11 @@
 bug48956/bug: Add regular expression support for SSI. (markt)
   /add
   add
+bug49165/bug: Allow any time stamp formats supported by
+SimpleDateFormat in AccessLogValve. Support logging begin and/or end of
+request. (rjung)
+  /add
+  add
 bug50677/bug: Allow system property variables to be used in the
 values of common.loader and other *.loader properties in the
 codecatalina.properties/code file. (kkolinko)
@@ -64,10 +69,6 @@
 so only types of interest are reported to a 
ServletContainerInitializer.
 (markt)
   /fix
-  add
-bug49165/bug: Allow any time stamp formats supported by 
SimpleDateFormat
-in AccessLogValve. Support logging begin and/or end of request. (rjung)
-  /add
   update
 Add the Tomcat extras, ant-junit and Java Help Jars to the list of JARs
 to skip when scanning for TLDs and web fragments. (rjung)



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



svn commit: r1137806 - in /tomcat/trunk: java/org/apache/catalina/startup/ test/org/apache/catalina/startup/ test/webapp-3.0-fragments/ test/webapp-3.0-fragments/WEB-INF/ webapps/docs/

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 22:34:16 2011
New Revision: 1137806

URL: http://svn.apache.org/viewvc?rev=1137806view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=51396
Correctly handle jsp-file entries in web.xml when the JSP servlet has been 
configured via code when embedding Tomcat.

Added:
tomcat/trunk/test/webapp-3.0-fragments/bug51396.jsp   (with props)
Modified:
tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java
tomcat/trunk/test/webapp-3.0-fragments/WEB-INF/web.xml
tomcat/trunk/webapps/docs/changelog.xml

Modified: tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1137806r1=1137805r2=1137806view=diff
==
--- tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java Mon Jun 20 
22:34:16 2011
@@ -1381,15 +1381,29 @@ public class ContextConfig
 }
 
 private void convertJsps(WebXml webXml) {
+MapString,String jspInitParams;
 ServletDef jspServlet = webXml.getServlets().get(jsp);
+if (jspServlet == null) {
+jspInitParams = new HashMapString,String();
+Wrapper w = (Wrapper) context.findChild(jsp);
+if (w != null) {
+String[] params = w.findInitParameters();
+for (String param : params) {
+jspInitParams.put(param, w.findInitParameter(param));
+}
+}
+} else {
+jspInitParams = jspServlet.getParameterMap();
+}
 for (ServletDef servletDef: webXml.getServlets().values()) {
 if (servletDef.getJspFile() != null) {
-convertJsp(servletDef, jspServlet);
+convertJsp(servletDef, jspInitParams);
 }
 }
 }
 
-private void convertJsp(ServletDef servletDef, ServletDef jspServletDef) {
+private void convertJsp(ServletDef servletDef,
+MapString,String jspInitParams) {
 
servletDef.setServletClass(org.apache.catalina.core.Constants.JSP_SERVLET_CLASS);
 String jspFile = servletDef.getJspFile();
 if ((jspFile != null)  !jspFile.startsWith(/)) {
@@ -1405,7 +1419,7 @@ public class ContextConfig
 }
 servletDef.getParameterMap().put(jspFile, jspFile);
 servletDef.setJspFile(null);
-for (Map.EntryString, String initParam: 
jspServletDef.getParameterMap().entrySet()) {
+for (Map.EntryString, String initParam: jspInitParams.entrySet()) {
 servletDef.addInitParameter(initParam.getKey(), 
initParam.getValue());
 }
 }

Modified: tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java?rev=1137806r1=1137805r2=1137806view=diff
==
--- tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java 
(original)
+++ tomcat/trunk/test/org/apache/catalina/startup/TestContextConfig.java Mon 
Jun 20 22:34:16 2011
@@ -69,6 +69,23 @@ public class TestContextConfig extends T
 assertEquals(OK - Custom default Servlet, res.toString());
 }
 
+public void testBug51396() throws Exception {
+Tomcat tomcat = getTomcatInstance();
+
+File appDir =  new File(test/webapp-3.0-fragments);
+// app dir is relative to server home
+tomcat.addWebapp(null, /test, appDir.getAbsolutePath());
+
+tomcat.start();
+
+ByteChunk bc = new ByteChunk();
+int rc = getUrl(http://localhost:; + getPort() +
+/test/bug51396.jsp, bc, null);
+
+assertEquals(HttpServletResponse.SC_OK, rc);
+assertTrue(bc.toString().contains(pOK/p));
+}
+
 private static class CustomDefaultServletSCI
 implements ServletContainerInitializer {
 

Modified: tomcat/trunk/test/webapp-3.0-fragments/WEB-INF/web.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/webapp-3.0-fragments/WEB-INF/web.xml?rev=1137806r1=1137805r2=1137806view=diff
==
--- tomcat/trunk/test/webapp-3.0-fragments/WEB-INF/web.xml (original)
+++ tomcat/trunk/test/webapp-3.0-fragments/WEB-INF/web.xml Mon Jun 20 22:34:16 
2011
@@ -43,4 +43,10 @@
 /web-resource-collection
   /security-constraint
 
+  !-- Bug 51396 --
+  servlet
+servlet-namebug51396/servlet-name
+jsp-file/bug51396.jsp/jsp-file
+  /servlet
+
 /web-app
\ No newline at end of file

Added: tomcat/trunk/test/webapp-3.0-fragments/bug51396.jsp
URL: 

DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|REOPENED|RESOLVED
 Resolution||FIXED

--- Comment #7 from Mark Thomas ma...@apache.org 2011-06-20 22:38:25 UTC ---
Fixed in 7.0.x and will be included in 7.0.17 onwards.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

bmargulies bimargul...@gmail.com changed:

   What|Removed |Added

  Attachment #27182|0   |1
is obsolete||

--- Comment #8 from bmargulies bimargul...@gmail.com 2011-06-20 22:40:22 UTC 
---
Created attachment 27183
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27183
Patch including fix to the problem.

Here we have the missing if statement to fix the problem, too.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #9 from bmargulies bimargul...@gmail.com 2011-06-20 22:42:30 UTC 
---
Well, now we've completed the whole story in parallel. 

Debugging the functions in ContextConfig, I think it is semi-fair to say that
the jsp servlet is not, in fact, defined -- in web.xml-space, where the code is
looking for it.

Perhaps my JUnit test would find a home.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

  Attachment #27183|0   |1
is obsolete||

--- Comment #10 from Mark Thomas ma...@apache.org 2011-06-20 22:45:16 UTC ---
Comment on attachment 27183
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27183
Patch including fix to the problem.

The patch fixes the symptom, not the cause.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51396] Embedding class cannot launch a webapp with a jsp servlet

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51396

--- Comment #11 from bmargulies bimargul...@gmail.com 2011-06-20 22:51:14 UTC 
---
Just for the record, it's not that I didn't see the importance of fishing the
init params out of where they were, it's that I couldn't work out for myself
where to find them. That doesn't make it the right patch, of course.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 43790] concurrent access issue on TagHandlerPool

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=43790

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|ASSIGNED|NEW

--- Comment #4 from Mark Thomas ma...@apache.org 2011-06-20 23:01:48 UTC ---
ThreadLocal isn't the way to do this. That is likely to trigger memory leaks.

A better solution would be to replace the syncs in the TagHandlerPool with a
solution based on a LinkedBlockingQueue.

The PerThreadTagHandlerPool needs to be deprecated.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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: r1137815 - /tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 23:02:10 2011
New Revision: 1137815

URL: http://svn.apache.org/viewvc?rev=1137815view=rev
Log:
Deprecated TagPool that may trigger memory leaks.

Modified:
tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java

Modified: 
tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java?rev=1137815r1=1137814r2=1137815view=diff
==
--- tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 
(original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/PerThreadTagHandlerPool.java 
Mon Jun 20 23:02:10 2011
@@ -31,7 +31,11 @@ import org.apache.jasper.Constants;
  *
  * @author Jan Luehe
  * @author Costin Manolache
+ * 
+ * @deprecated Use of ThreadLocals is likely to trigger memory leaks. Use
+ * TagHandlerPool. Will be removed in Tomcat 8.0.x.
  */
+@Deprecated
 public class PerThreadTagHandlerPool extends TagHandlerPool {
 
 private int maxSize;



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



svn commit: r1137819 - /tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java

2011-06-20 Thread markt
Author: markt
Date: Mon Jun 20 23:09:49 2011
New Revision: 1137819

URL: http://svn.apache.org/viewvc?rev=1137819view=rev
Log:
Auto format

Modified:
tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java

Modified: tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java?rev=1137819r1=1137818r2=1137819view=diff
==
--- tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java (original)
+++ tomcat/trunk/java/org/apache/jasper/runtime/TagHandlerPool.java Mon Jun 20 
23:09:49 2011
@@ -28,53 +28,54 @@ import org.apache.tomcat.InstanceManager
 
 /**
  * Pool of tag handlers that can be reused.
- *
+ * 
  * @author Jan Luehe
  */
 public class TagHandlerPool {
 
 private Tag[] handlers;
 
-public static final String OPTION_TAGPOOL=tagpoolClassName;
-public static final String OPTION_MAXSIZE=tagpoolMaxSize;
+public static final String OPTION_TAGPOOL = tagpoolClassName;
+public static final String OPTION_MAXSIZE = tagpoolMaxSize;
 
 private final Log log = LogFactory.getLog(TagHandlerPool.class);
-
+
 // index of next available tag handler
 private int current;
 protected InstanceManager instanceManager = null;
 
-public static TagHandlerPool getTagHandlerPool( ServletConfig config) {
-TagHandlerPool result=null;
+public static TagHandlerPool getTagHandlerPool(ServletConfig config) {
+TagHandlerPool result = null;
 
-String tpClassName=getOption( config, OPTION_TAGPOOL, null);
-if( tpClassName != null ) {
+String tpClassName = getOption(config, OPTION_TAGPOOL, null);
+if (tpClassName != null) {
 try {
-Class? c=Class.forName( tpClassName );
-result=(TagHandlerPool)c.newInstance();
+Class? c = Class.forName(tpClassName);
+result = (TagHandlerPool) c.newInstance();
 } catch (Exception e) {
 e.printStackTrace();
-result=null;
+result = null;
 }
 }
-if( result==null ) result=new TagHandlerPool();
+if (result == null)
+result = new TagHandlerPool();
 result.init(config);
 
 return result;
 }
 
-protected void init( ServletConfig config ) {
-int maxSize=-1;
-String maxSizeS=getOption(config, OPTION_MAXSIZE, null);
-if( maxSizeS != null ) {
+protected void init(ServletConfig config) {
+int maxSize = -1;
+String maxSizeS = getOption(config, OPTION_MAXSIZE, null);
+if (maxSizeS != null) {
 try {
-maxSize=Integer.parseInt(maxSizeS);
-} catch( Exception ex) {
-maxSize=-1;
+maxSize = Integer.parseInt(maxSizeS);
+} catch (Exception ex) {
+maxSize = -1;
 }
 }
-if( maxSize 0  ) {
-maxSize=Constants.MAX_POOL_SIZE;
+if (maxSize  0) {
+maxSize = Constants.MAX_POOL_SIZE;
 }
 this.handlers = new Tag[maxSize];
 this.current = -1;
@@ -92,16 +93,16 @@ public class TagHandlerPool {
 /**
  * Gets the next available tag handler from this tag handler pool,
  * instantiating one if this tag handler pool is empty.
- *
- * @param handlerClass Tag handler class
- *
+ * 
+ * @param handlerClass
+ *Tag handler class
  * @return Reused or newly instantiated tag handler
- *
- * @throws JspException if a tag handler cannot be instantiated
+ * @throws JspException
+ * if a tag handler cannot be instantiated
  */
 public Tag get(Class? extends Tag handlerClass) throws JspException {
 Tag handler;
-synchronized( this ) {
+synchronized (this) {
 if (current = 0) {
 handler = handlers[current--];
 return handler;
@@ -112,7 +113,8 @@ public class TagHandlerPool {
 // wait for us to construct a tag for this thread.
 try {
 if (Constants.USE_INSTANCE_MANAGER_FOR_TAGS) {
-return (Tag) 
instanceManager.newInstance(handlerClass.getName(), 
handlerClass.getClassLoader());
+return (Tag) instanceManager.newInstance(
+handlerClass.getName(), handlerClass.getClassLoader());
 } else {
 Tag instance = handlerClass.newInstance();
 instanceManager.newInstance(instance);
@@ -127,11 +129,12 @@ public class TagHandlerPool {
  * Adds the given tag handler to this tag handler pool, unless this tag
  * handler pool has already reached its capacity, in which case the tag
  * handler's release() method is called.
- *
- * @param handler Tag handler to 

DO NOT REPLY [Bug 43790] concurrent access issue on TagHandlerPool

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=43790

--- Comment #5 from Mark Thomas ma...@apache.org 2011-06-21 00:28:33 UTC ---
Created attachment 27184
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27184
Patche based on LinkedBlockingQueue

While switching to LinkedBlockingQueue allows concurrent get and reuse, that
appears to be balanced by the additional complexity over the current
implementation.

Testing with JMeter showed no measurable performance benefit of the current
implementation over the patch. I have attached the patch for future reference.

I would like to see a test case that demonstrates a clear performance benefit
before applying this or any other patch.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 43790] concurrent access issue on TagHandlerPool

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=43790

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

  Attachment #21404|0   |1
is obsolete||

--- Comment #6 from Mark Thomas ma...@apache.org 2011-06-21 00:28:59 UTC ---
Comment on attachment 21404
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=21404
Simple threadLocal based TagHandler

ThreadLocal is not an option due to the memory leaks it triggers.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 43790] concurrent access issue on TagHandlerPool

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=43790

Mark Thomas ma...@apache.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX

--- Comment #7 from Mark Thomas ma...@apache.org 2011-06-21 00:33:04 UTC ---
ThreadLocals aren't an option, LinkedBlockingQueue appears to provide no
performance benefit, the current code is fairly efficient given the constraints
it has to work with and there is no obvious, safe way to speed this up so
resolving as WONTFIX. It can always be re-opened if a potential test case and
patch is identified.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51400] New: Use of new String(byte[] b, String enc) hits Sun JVM bottleneck

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51400

 Bug #: 51400
   Summary: Use of new String(byte[] b, String enc) hits Sun JVM
bottleneck
   Product: Tomcat 6
   Version: 6.0.32
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: dengb...@evernote.com
Classification: Unclassified


Created attachment 27186
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27186
Patch with optimizations

We're using Tomcat 6 for a high-volume, high-concurrency service (Evernote). 
At times, we've seen a performance slowdown within the service, which we've
traced to a concurrency flaw within the JVM code that translates named
encodings (e.g. utf-8) into Charsets.  This translates into a number of stuck
threads trying to convert a byte array to a String or vice versa, ala:

  java.lang.Thread.State: BLOCKED (on object monitor)
   at sun.nio.cs.FastCharsetProvider.charsetForName(Unknown Source)
   - waiting to lock 0x7ff3b4cc85b0 (a sun.nio.cs.StandardCharsets)
   at java.nio.charset.Charset.lookup2(Unknown Source)
   at java.nio.charset.Charset.lookup(Unknown Source)
   at java.nio.charset.Charset.isSupported(Unknown Source)
   at java.lang.StringCoding.lookupCharset(Unknown Source)
   at java.lang.StringCoding.decode(Unknown Source)
   at java.lang.String.init(Unknown Source)
   at
org.apache.tomcat.util.buf.ByteChunk.toStringInternal(ByteChunk.java:499)
   at org.apache.tomcat.util.buf.StringCache.toString(StringCache.java:315)
   at org.apache.tomcat.util.buf.ByteChunk.toString(ByteChunk.java:492)
   at
org.apache.tomcat.util.buf.MessageBytes.toString(MessageBytes.java:213)
   at
org.apache.tomcat.util.http.MimeHeaders.getHeader(MimeHeaders.java:319)
   at org.apache.coyote.Request.getHeader(Request.java:330)
   at org.apache.catalina.connector.Request.getHeader(Request.java:1854)
   at
org.apache.catalina.connector.RequestFacade.getHeader(RequestFacade.java:643)

This isn't a true deadlock, since each thread will eventually finish, but it
can
significantly affect concurrency if there are a number of threads making heavy
use of:
   new String(byte[] b, String encoding)
   String.getBytes()
   String.getBytes(String encoding)

This is, unfortunately, a known bottleneck within the JVM:
http://blog.inuus.com/vox/2008/05/the-mysteries-of-java-character-set-performance.html
http://halfbottle.blogspot.com/2009/07/charset-continued-i-wrote-about.html
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6790402


To avoid this bottleneck in the JVM, we've patched our server to use the
explicit Charset object for String encoding rather than the name of the
charset, and then added a ConcurrentHashMapString, Charset to lookup charsets
by encodings.

I've attached a patch with our fixes on 6.0.32

Just as a random FYI - the same issue hits MySQL's Java connector, so we'd
occasionally see Tomcat and MySQL fighting over this same JVM chokepoint: 
http://bugs.mysql.com/bug.php?id=61105

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51401] New: java.lang.IllegalArgumentException: session-config element is limited to 1 occurrence

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51401

 Bug #: 51401
   Summary: java.lang.IllegalArgumentException: session-config
element is limited to 1 occurrence
   Product: Tomcat 7
   Version: trunk
  Platform: All
OS/Version: All
Status: NEW
  Severity: major
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: mashm...@gmail.com
Classification: Unclassified


Created attachment 27188
  -- https://issues.apache.org/bugzilla/attachment.cgi?id=27188
logfile

I got following Exception when I started Tomcat.
I hadn't changed any configuration.

-
java.lang.IllegalArgumentException: session-config element is limited to 1
occurrence
at
org.apache.catalina.startup.SetSessionConfig.begin(WebRuleSet.java:722)
at
org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1543)
at
org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1744)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1241)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:885)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:344)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5103)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:932)
at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:723)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89)
at
org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:379)
at
org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:324)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
at
org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
at
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.startup.Catalina.start(Catalina.java:620)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at

DO NOT REPLY [Bug 51401] java.lang.IllegalArgumentException: session-config element is limited to 1 occurrence

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51401

--- Comment #1 from Eiji Takahashi mashm...@gmail.com 2011-06-21 01:59:01 UTC 
---
(In reply to comment #0)
 When I reverted the code back to the revision 1137764, I got no exception.
 Regards.

Oops, sorry. Revision 1137764 is not correct. 1137693 is correct revesion.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



DO NOT REPLY [Bug 51253] use_server_errors for status 401 does not forward WWW-Authenticate

2011-06-20 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=51253

Charles Parker chuck.t.par...@gmail.com changed:

   What|Removed |Added

 CC||chuck.t.par...@gmail.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- 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



Re: svn commit: r1137803 - /tomcat/trunk/webapps/docs/changelog.xml

2011-06-20 Thread Rainer Jung
On 21.06.2011 00:28, ma...@apache.org wrote:
 Author: markt
 Date: Mon Jun 20 22:28:57 2011
 New Revision: 1137803
 
 URL: http://svn.apache.org/viewvc?rev=1137803view=rev
 Log:
 Ordering
 
 Modified:
 tomcat/trunk/webapps/docs/changelog.xml

I always forget whether there's a standard (I would like to have one):

- Ordering of sections: OK, defined by comment in changelog
- Ordering inside section:
  - chronological (oldest first or last)?
  - first by add, update, fix (in which order?)
and then chronological (oldest first or last)?

If the rule is clear, I can add it as another comment into the file.

Who knows the rules?

Regards,

Rainer

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



svn commit: r1137862 - in /tomcat/trunk/bin: catalina.bat catalina.sh

2011-06-20 Thread rjung
Author: rjung
Date: Tue Jun 21 05:30:55 2011
New Revision: 1137862

URL: http://svn.apache.org/viewvc?rev=1137862view=rev
Log:
Define CATALINA_BASE fallback earlier,
so one can use CATALINA_BASE and CATALINA_HOME
variables in setenv without knowing, whether
the two have been split (i.e. CATALINA_BASE is
set) or not.

Modified:
tomcat/trunk/bin/catalina.bat
tomcat/trunk/bin/catalina.sh

Modified: tomcat/trunk/bin/catalina.bat
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.bat?rev=1137862r1=1137861r2=1137862view=diff
==
--- tomcat/trunk/bin/catalina.bat (original)
+++ tomcat/trunk/bin/catalina.bat Tue Jun 21 05:30:55 2011
@@ -109,12 +109,18 @@ cd ..
 set CATALINA_HOME=%cd%
 cd %CURRENT_DIR%
 :gotHome
+
 if exist %CATALINA_HOME%\bin\catalina.bat goto okHome
 echo The CATALINA_HOME environment variable is not defined correctly
 echo This environment variable is needed to run this program
 goto end
 :okHome
 
+rem Copy CATALINA_BASE from CATALINA_HOME if not defined
+if not %CATALINA_BASE% ==  goto gotBase
+set CATALINA_BASE=%CATALINA_HOME%
+:gotBase
+
 rem Ensure that any user defined CLASSPATH variables are not used on startup,
 rem but allow them to be specified in setenv.bat, in rare case when it is 
needed.
 set CLASSPATH=
@@ -145,10 +151,6 @@ set CLASSPATH=%CLASSPATH%;
 :emptyClasspath
 set CLASSPATH=%CLASSPATH%%CATALINA_HOME%\bin\bootstrap.jar
 
-if not %CATALINA_BASE% ==  goto gotBase
-set CATALINA_BASE=%CATALINA_HOME%
-:gotBase
-
 if not %CATALINA_TMPDIR% ==  goto gotTmpdir
 set CATALINA_TMPDIR=%CATALINA_BASE%\temp
 :gotTmpdir

Modified: tomcat/trunk/bin/catalina.sh
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.sh?rev=1137862r1=1137861r2=1137862view=diff
==
--- tomcat/trunk/bin/catalina.sh (original)
+++ tomcat/trunk/bin/catalina.sh Tue Jun 21 05:30:55 2011
@@ -115,6 +115,9 @@ PRGDIR=`dirname $PRG`
 # Only set CATALINA_HOME if not already set
 [ -z $CATALINA_HOME ]  CATALINA_HOME=`cd $PRGDIR/.. /dev/null; pwd`
 
+# Copy CATALINA_BASE from CATALINA_HOME if not already set
+[ -z $CATALINA_BASE ]  CATALINA_BASE=$CATALINA_HOME
+
 # Ensure that any user defined CLASSPATH variables are not used on startup,
 # but allow them to be specified in setenv.sh, in rare case when it is needed.
 CLASSPATH=
@@ -172,10 +175,6 @@ if [ ! -z $CLASSPATH ] ; then
 fi
 CLASSPATH=$CLASSPATH$CATALINA_HOME/bin/bootstrap.jar
 
-if [ -z $CATALINA_BASE ] ; then
-  CATALINA_BASE=$CATALINA_HOME
-fi
-
 if [ -z $CATALINA_OUT ] ; then
   CATALINA_OUT=$CATALINA_BASE/logs/catalina.out
 fi



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