Re: Atomicity violation in removeAttribute
Hello, I'd rather use the compareAndSet method in AtomicReference for this particular task. On Sun, Sep 26, 2010 at 4:00 PM, Ohad Shacham wrote: > Hi, > > > In addition to the behavior we experienced in function setAttribute. We > also > experienced another atomicity violation in function removeAttribute. > > The following code is located at the beginning of function removeAttribute > at class ApplicationContext. This code fragment intends to check whether a > key is already inside the “attributes” collection. If it does, then the key > is removed from the collection and the function continues running while > assigning the corresponding value to “value”. Otherwise, the function > should > return. > > > > > found = attributes.containsKey(name); > > if (found) { > > value = attributes.get(name); > >attributes.remove(name); > > } else { > > return; > > } > > > > This code can behave non atomically when two different threads call > removeAttribute function with the same attribute name. In this case, there > exists a thread interleaving where two threads enter the “if” condition > while the first one removes “name” from the attributes collection before > the > second one runs the get operation. This causes the function to continue > running with value == null instead of returning. > > > > Could you please let me know whether you consider this as a bug? > > > > A possible way of modifying the code in order to execute this code > atomically is as follows: > > > > if (attributes.containsKey(name)) { >value = attributes.remove(name); >if (value == null) >return; > } > > > > Thanks, > > Ohad > -- Sincerely yours and Best Regards, Xie Xiaodong
DO NOT REPLY [Bug 50001] Eclipse source files don't belong in project root.
https://issues.apache.org/bugzilla/show_bug.cgi?id=50001 Rainer Jung changed: What|Removed |Added CC|dev@tomcat.apache.org | -- Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email --- You are receiving this mail because: --- You are on the CC list for the bug. 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: Atomicity violation in removeAttribute
On 26 September 2010 15:00, Ohad Shacham wrote: > Hi, > > > In addition to the behavior we experienced in function setAttribute. We also > experienced another atomicity violation in function removeAttribute. > > The following code is located at the beginning of function removeAttribute > at class ApplicationContext. This code fragment intends to check whether a > key is already inside the “attributes” collection. If it does, then the key > is removed from the collection and the function continues running while > assigning the corresponding value to “value”. Otherwise, the function should > return. > > > > > found = attributes.containsKey(name); > > if (found) { > > value = attributes.get(name); > > attributes.remove(name); > > } else { > > return; > > } > > > > This code can behave non atomically when two different threads call > removeAttribute function with the same attribute name. In this case, there > exists a thread interleaving where two threads enter the “if” condition > while the first one removes “name” from the attributes collection before the > second one runs the get operation. This causes the function to continue > running with value == null instead of returning. > > > > Could you please let me know whether you consider this as a bug? > > > > A possible way of modifying the code in order to execute this code > atomically is as follows: > > > > if (attributes.containsKey(name)) { > value = attributes.remove(name); > if (value == null) > return; > } That's not quite the same if atttributes.get() can return null, as previously the null would be used in subsequent code. If get() cannot return null, then I think one can just use: value = attributes.remove(name); if (value == null) return; If it is important to distinguish null entries from missing entries, then a different approach is needed - e.g. AtomicReference as suggested elsewhere > > > Thanks, > > Ohad > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49683] Separate keep-alive and connection timeout with APR/native connector
https://issues.apache.org/bugzilla/show_bug.cgi?id=49683 Mark Thomas changed: What|Removed |Added Summary|Separate async, keep-alive, |Separate keep-alive and |connection timeout with |connection timeout with |APR/native connector|APR/native connector --- Comment #2 from Mark Thomas 2010-09-27 08:02:32 EDT --- More refactoring resulting in not using the APR poller for async timeouts so this is no longer an issue for async. -- 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 49884] NullPointerException in org.apache.catalina.core.AsyncContextImpl.doInternalComplete
https://issues.apache.org/bugzilla/show_bug.cgi?id=49884 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #7 from Mark Thomas 2010-09-27 08:14:41 EDT --- This has been fixed in trunk and will be included in 7.0.3. Thanks for uncovering this. It highlighted a bunch of issues with the async implementation that are hopefully now fixed. -- 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: r1001698 [1/2] - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/security/ java/org/apache/coyote/ java/org/apache/coyote/
On 27/09/2010 13:13, ma...@apache.org wrote: > Author: markt > Date: Mon Sep 27 12:13:32 2010 > New Revision: 1001698 > The following work remains: > - Testing all connectors (HTTP and AJP) with TCK + security manager and > fixing whatever is broken Just as soon as I get this done, I plan to roll a 7.0.3 release. Hopefully this week although given how long it took me to get this commit ready... Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001717 - in /tomcat/tc6.0.x/trunk: STATUS.txt build.properties.default extras.xml webapps/docs/changelog.xml
Author: markt Date: Mon Sep 27 12:55:18 2010 New Revision: 1001717 URL: http://svn.apache.org/viewvc?rev=1001717&view=rev Log: Enable the off-line building of the extras package Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/build.properties.default tomcat/tc6.0.x/trunk/extras.xml tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1001717&r1=1001716&r2=1001717&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 27 12:55:18 2010 @@ -138,13 +138,6 @@ PATCHES PROPOSED TO BACKPORT: but from debugging it looks that it is called by Tomcat code only (JspServlet). -* Allow off-line building of the extras packages. Also saves downloading deps - every build - http://people.apache.org/~markt/patches/2010-08-23-offline-extras-tc6.patch - +1: markt, rjung, kkolinko - -1: - rjung: s/vesion/version/g - * When a cluster node disappears when using the backup manager, handle the failed ping message rather than propagating the exception (which just logs the stack trace but doesn't do anything to deal with the failure) Modified: tomcat/tc6.0.x/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/build.properties.default?rev=1001717&r1=1001716&r2=1001717&view=diff == --- tomcat/tc6.0.x/trunk/build.properties.default (original) +++ tomcat/tc6.0.x/trunk/build.properties.default Mon Sep 27 12:55:18 2010 @@ -46,14 +46,54 @@ compile.debug=true base-commons.loc=http://archive.apache.org/dist/commons base-tomcat.loc=http://archive.apache.org/dist/tomcat base-sf.loc=http://downloads.sourceforge.net +base-maven1.loc=http://repo1.maven.org/maven # - Commons Logging, version 1.1 or later - -commons-logging-version=1.1.1 -commons-logging-src.loc=${base-commons.loc}/logging/source/commons-logging-${commons-logging-version}-src.tar.gz - -# - Webservices - -jaxrpc-src.loc=http://repo1.maven.org/maven2/geronimo-spec/geronimo-spec-jaxrpc/1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar -wsdl4j-src.loc=http://repo1.maven.org/maven2/wsdl4j/wsdl4j/1.6.1/wsdl4j-1.6.1.jar +# If this version is updated, check the versions required for the deps +# - avalon-framework +# - log4j +# - logkit +# - servletapi +commons-logging.version=1.1.1 +commons-logging.home=${base.path}/commons-logging-${commons-logging.version} +commons-logging-src.loc=${base-commons.loc}/logging/source/commons-logging-${commons-logging.version}-src.tar.gz +commons-logging-src.tar.gz=${commons-logging.home}/commons-logging-${commons-logging.version}-src.tar.gz + +# - Avalon Framework (required by commons logging) - +avalon-framework.version=4.1.3 +avalon-framework.home=${base.path}/avalon-framework-${avalon-framework.version} +avalon-framework.loc=${base-maven1.loc}/avalon-framework/jars/avalon-framework-${avalon-framework.version}.jar +avalon-framework.jar=${avalon-framework.home}/avalon-framework-${avalon-framework.version}.jar + +# - log4j (required by commons logging) - +log4j.version=1.2.12 +log4j.home=${base.path}/log4j-${log4j.version} +log4j.loc=${base-maven1.loc}/log4j/jars/log4j-${log4j.version}.jar +log4j.jar=${log4j.home}/log4j-${log4j.version}.jar + +# - logkit (required by commons logging) - +logkit.version=1.0.1 +logkit.home=${base.path}/logkit-${logkit.version} +logkit.loc=${base-maven1.loc}/logkit/jars/logkit-${logkit.version}.jar +logkit.jar=${logkit.home}/logkit-${logkit.version}.jar + +# - servletapi (required by commons logging) - +servletapi.version=2.3 +servletapi.home=${base.path}/servletapi-${servletapi.version} +servletapi.loc=${base-maven1.loc}/servletapi/jars/servletapi-${servletapi.version}.jar +servletapi.jar=${servletapi.home}/servletapi-${servletapi.version}.jar + +# - Webservices - JAX RPC - +jaxrpc-lib.version=1.1-rc4 +jaxrpc-lib.home=${base.path}/jaxrpc-${jaxrpc-lib.version} +jaxrpc-lib.loc=http://repo1.maven.org/maven2/geronimo-spec/geronimo-spec-jaxrpc/${jaxrpc-lib.version}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar +jaxrpc-lib.jar=${jaxrpc-lib.home}/geronimo-spec-jaxrpc-${jaxrpc-lib.version}.jar + +# - Webservices - WSDL4J - +wsdl4j-lib.version=1.6.1 +wsdl4j-lib.home=${base.path}/wsdl4j-${wsdl4j-lib.version} +wsdl4j-lib.loc=http://repo1.maven.org/maven2/wsdl4j/wsdl4j/${wsdl4j-lib.version}/wsdl4j-${wsdl4j-lib.version}.jar +wsdl4j-lib.jar=${wsdl4j-lib.home}/wsdl4j-${wsdl4j-lib.version}.jar # - Eclipse JDT, version 3.2 or later - # When updating this, also need to update: Modified: tomcat/tc6.0.x/trunk/extras.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/extras.xml?rev=1001717&r1=1001716&r2=1001717&view=diff ===
svn commit: r1001718 - /tomcat/trunk/build.properties.default
Author: markt Date: Mon Sep 27 12:56:38 2010 New Revision: 1001718 URL: http://svn.apache.org/viewvc?rev=1001718&view=rev Log: (empty) Modified: tomcat/trunk/build.properties.default Modified: tomcat/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1001718&r1=1001717&r2=1001718&view=diff == --- tomcat/trunk/build.properties.default (original) +++ tomcat/trunk/build.properties.default Mon Sep 27 12:56:38 2010 @@ -24,7 +24,7 @@ # $Id$ # - -# - Vesion Control Flags - +# - Version Control Flags - version.major=7 version.minor=0 version.build=3 @@ -72,28 +72,28 @@ commons-logging-src.loc=${base-commons.l commons-logging-src.tar.gz=${commons-logging.home}/commons-logging-${commons-logging.version}-src.tar.gz # - Avalon Framework (required by commons logging) - -avalon-framework.vesion=4.1.3 -avalon-framework.home=${base.path}/avalon-framework-${avalon-framework.vesion} -avalon-framework.loc=${base-maven1.loc}/avalon-framework/jars/avalon-framework-${avalon-framework.vesion}.jar -avalon-framework.jar=${avalon-framework.home}/avalon-framework-${avalon-framework.vesion}.jar +avalon-framework.version=4.1.3 +avalon-framework.home=${base.path}/avalon-framework-${avalon-framework.version} +avalon-framework.loc=${base-maven1.loc}/avalon-framework/jars/avalon-framework-${avalon-framework.version}.jar +avalon-framework.jar=${avalon-framework.home}/avalon-framework-${avalon-framework.version}.jar # - log4j (required by commons logging) - -log4j.vesion=1.2.12 -log4j.home=${base.path}/log4j-${log4j.vesion} -log4j.loc=${base-maven1.loc}/log4j/jars/log4j-${log4j.vesion}.jar -log4j.jar=${log4j.home}/log4j-${log4j.vesion}.jar +log4j.version=1.2.12 +log4j.home=${base.path}/log4j-${log4j.version} +log4j.loc=${base-maven1.loc}/log4j/jars/log4j-${log4j.version}.jar +log4j.jar=${log4j.home}/log4j-${log4j.version}.jar # - logkit (required by commons logging) - -logkit.vesion=1.0.1 -logkit.home=${base.path}/logkit-${logkit.vesion} -logkit.loc=${base-maven1.loc}/logkit/jars/logkit-${logkit.vesion}.jar -logkit.jar=${logkit.home}/logkit-${logkit.vesion}.jar +logkit.version=1.0.1 +logkit.home=${base.path}/logkit-${logkit.version} +logkit.loc=${base-maven1.loc}/logkit/jars/logkit-${logkit.version}.jar +logkit.jar=${logkit.home}/logkit-${logkit.version}.jar # - servletapi (required by commons logging) - -servletapi.vesion=2.3 -servletapi.home=${base.path}/servletapi-${servletapi.vesion} -servletapi.loc=${base-maven1.loc}/servletapi/jars/servletapi-${servletapi.vesion}.jar -servletapi.jar=${servletapi.home}/servletapi-${servletapi.vesion}.jar +servletapi.version=2.3 +servletapi.home=${base.path}/servletapi-${servletapi.version} +servletapi.loc=${base-maven1.loc}/servletapi/jars/servletapi-${servletapi.version}.jar +servletapi.jar=${servletapi.home}/servletapi-${servletapi.version}.jar # - Webservices - JAX RPC - jaxrpc-lib.version=1.1-rc4 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001719 - /tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java
Author: markt Date: Mon Sep 27 12:58:06 2010 New Revision: 1001719 URL: http://svn.apache.org/viewvc?rev=1001719&view=rev Log: Fix comment typo Modified: tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1001719&r1=1001718&r2=1001719&view=diff == --- tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Mon Sep 27 12:58:06 2010 @@ -265,7 +265,7 @@ public abstract class AbstractReplicated memberAlive(resp[i].getSource()); } } catch (ChannelException ce) { -// Handle known failed membersq +// Handle known failed members FaultyMember[] faultyMembers = ce.getFaultyMembers(); for (FaultyMember faultyMember : faultyMembers) { memberDisappeared(faultyMember.getMember()); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001720 - in /tomcat/tc6.0.x/trunk: STATUS.txt java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java webapps/docs/changelog.xml
Author: markt Date: Mon Sep 27 13:00:56 2010 New Revision: 1001720 URL: http://svn.apache.org/viewvc?rev=1001720&view=rev Log: When a cluster node disappears when using the backup manager, handle the failed ping message rather than propagating the exception (which just logs the stack trace but doesn't do anything to deal with the failure) Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1001720&r1=1001719&r2=1001720&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 27 13:00:56 2010 @@ -138,14 +138,6 @@ PATCHES PROPOSED TO BACKPORT: but from debugging it looks that it is called by Tomcat code only (JspServlet). -* When a cluster node disappears when using the backup manager, handle the - failed ping message rather than propagating the exception (which just logs the - stack trace but doesn't do anything to deal with the failure) - http://svn.apache.org/viewvc?rev=993007&view=rev - +1: markt, kfujino, kkolinko - -1: - kkolinko: s/membersq/members/ in a comment - * Make sure Contexts defined in server.xml pick up any configClass setting from the parent Host. http://people.apache.org/~markt/patches/2010-09-11-configClass.patch Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java?rev=1001720&r1=1001719&r2=1001720&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java Mon Sep 27 13:00:56 2010 @@ -33,6 +33,7 @@ import java.util.Set; import org.apache.catalina.tribes.Channel; import org.apache.catalina.tribes.ChannelException; +import org.apache.catalina.tribes.ChannelException.FaultyMember; import org.apache.catalina.tribes.ChannelListener; import org.apache.catalina.tribes.Heartbeat; import org.apache.catalina.tribes.Member; @@ -253,6 +254,7 @@ public abstract class AbstractReplicated channel.getLocalMember(false), null); if ( channel.getMembers().length > 0 ) { +try { //send a ping, wait for all nodes to reply Response[] resp = rpcChannel.send(channel.getMembers(), msg, rpcChannel.ALL_REPLY, @@ -260,7 +262,14 @@ public abstract class AbstractReplicated (int) accessTimeout); for (int i = 0; i < resp.length; i++) { memberAlive(resp[i].getSource()); -} //for +} +} catch (ChannelException ce) { +// Handle known failed members +FaultyMember[] faultyMembers = ce.getFaultyMembers(); +for (FaultyMember faultyMember : faultyMembers) { +memberDisappeared(faultyMember.getMember()); +} +} } //update our map of members, expire some if we didn't receive a ping back synchronized (mapMembers) { Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1001720&r1=1001719&r2=1001720&view=diff == --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Sep 27 13:00:56 2010 @@ -117,6 +117,12 @@ Add Null check when CHANGE_SESSION_ID message received. (kfujino) + +When a cluster node disappears when using the backup manager, handle the +failed ping message rather than propagating the exception (which just +logs the stack trace but doesn't do anything to deal with the failure). +(markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001725 - in /tomcat/tc6.0.x/trunk: STATUS.txt build.properties.default webapps/docs/changelog.xml
Author: markt Date: Mon Sep 27 13:08:24 2010 New Revision: 1001725 URL: http://svn.apache.org/viewvc?rev=1001725&view=rev Log: Update to pool 1.5.5 Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/build.properties.default tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1001725&r1=1001724&r2=1001725&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 27 13:08:24 2010 @@ -146,12 +146,6 @@ PATCHES PROPOSED TO BACKPORT: kkolinko: A bit hard to understand. The proposal is about a rule that processes , but LifecycleListenerRule is used for and as well. -* Update commons pool to 1.5.5 - http://svn.apache.org/viewvc?rev=996163&view=rev - (Changelog: http://commons.apache.org/pool/changes-report.html#a1.5.5) - +1: markt, kkolinko, kfujino - -1: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49924 When non-primary node changes into a primary node, make sure isPrimarySession is changed to true. Modified: tomcat/tc6.0.x/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/build.properties.default?rev=1001725&r1=1001724&r2=1001725&view=diff == --- tomcat/tc6.0.x/trunk/build.properties.default (original) +++ tomcat/tc6.0.x/trunk/build.properties.default Mon Sep 27 13:08:24 2010 @@ -123,7 +123,7 @@ commons-dbcp.home=${base.path}/commons-d commons-dbcp-src.loc=${base-commons.loc}/dbcp/source/commons-dbcp-${commons-dbcp.version}-src.tar.gz # - Commons Pool, version 1.1 or later - -commons-pool.version=1.5.4 +commons-pool.version=1.5.5 commons-pool.home=${base.path}/commons-pool-${commons-pool.version}-src commons-pool-src.loc=${base-commons.loc}/pool/source/commons-pool-${commons-pool.version}-src.tar.gz Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=1001725&r1=1001724&r2=1001725&view=diff == --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Sep 27 13:08:24 2010 @@ -53,6 +53,9 @@ Allow the off-line building of the extras package. (markt) + +Update to Commons Pool 1.5.5. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Tomcat Wiki] Update of "TomcatHibernate" by SureshVayu gundla
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "TomcatHibernate" page has been changed by SureshVayugundla. http://wiki.apache.org/tomcat/TomcatHibernate?action=diff&rev1=2&rev2=3 -- - org.hibernate.connection.CP30ConnectionProvider + org.hibernate.connection.C3P0ConnectionProvider 5 1000 - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49979] SimpleDateFormat StringIndexOutOfBoundsException
https://issues.apache.org/bugzilla/show_bug.cgi?id=49979 sosig...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution||INVALID Severity|major |minor --- Comment #3 from sosig...@gmail.com 2010-09-27 09:32:07 EDT --- closing issue as it is really about the jdk 1.6.0_16 implementation, see SimpleDateFormat lines 1767-1785 // For time zones that have no known names, look for strings // of the form: //GMT[+-]hours:minutes or //GMT. if ((text.length() - start) >= GMT.length() && text.regionMatches(true, start, GMT, 0, GMT.length())) { int num; calendar.set(Calendar.DST_OFFSET, 0); pos.index = start + GMT.length(); try { // try-catch for "GMT" only time zone string char c = text.charAt(pos.index); if (c == '+') { sign = 1; } else if (c == '-') { sign = -1; } } catch(StringIndexOutOfBoundsException e) {} -- 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: Atomicity violation in setAttribute
Given that there is a violation, and the proposed solution is simpler, would you take it in the next release? Thanks, Ohad On Sun, Sep 26, 2010 at 10:42 PM, Tim Whittington wrote: > This is technically a race condition, but given the vague information > provided in ServletContextAttributeEvent (e.g. the inability to > differentiate adds vs replaces) I can't see it causing a real problem. > i.e. there's no atomicity in the interaction of an attribute listener > with the context, so a temporary internal inconsistency isn't going to > hurt. > > > val = attributes.put(name, value); > > if (val != null) > >replaced = true; > > +1 - this is simpler in any case. > > cheers > tim > > On Mon, Sep 27, 2010 at 6:25 AM, Ian Darwin wrote: > >> In this case, both threads will > >> continue running the function with ?replaced? bit turned on and the > oldValue > >> of both thread will point to the same location. This means that the > value of > >> the first thread that did the put operation will not be treated as a > value > >> that was replaced. > >> > >> Could you please let me know whether you consider this as a bug? > > > > Is it any different than if two threads invoke the operation serially? > > > > - > > 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 > >
DO NOT REPLY [Bug 50013] New: missing classes when running catalina ant tasks
https://issues.apache.org/bugzilla/show_bug.cgi?id=50013 Summary: missing classes when running catalina ant tasks Product: Tomcat 7 Version: trunk Platform: PC Status: NEW Severity: normal Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: sylvain.laur...@gmail.com With trunk after 7.0.2 : - tomcat-util.jar is missing in /bin/catalina-tasks.xml - even after adding this, I still have a NoClassDefFoundError for org.apache.tomcat.util.file.Matcher . Apparently this is a new class in a new package and the build script does not put it in any jar built. -- 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 50013] missing classes when running catalina ant tasks
https://issues.apache.org/bugzilla/show_bug.cgi?id=50013 --- Comment #1 from sylvain.laur...@gmail.com 2010-09-27 13:17:40 EDT --- Created an attachment (id=26086) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26086) proposed patch Proposed patch, I added org/apache/tomcat/util/file/** in tomcat-util.jar to fix the error -- 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 49811] [PATCH] Disable UrlRewriting
https://issues.apache.org/bugzilla/show_bug.cgi?id=49811 --- Comment #14 from Wesley 2010-09-27 13:57:52 EDT --- (In reply to comment #13) > Created an attachment (id=26018) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26018) [details] > V3 with tabs fixed and parameter name on Context interface changed. > > V3 of the patch. Hopefully the last one. > > Doing a scan of the source reveals several java files that already begin with > a > tab. > > Searching for ^\t Its been two weeks. I guess I should stop nudging this, Its not a critical issue, but if you want any more changes let me know. -- 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: r1001698 [1/2] - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/security/ java/org/apache/coyote/ java/org/apache/coyote/
On 27/09/2010 13:16, Mark Thomas wrote: > On 27/09/2010 13:13, ma...@apache.org wrote: >> Author: markt >> Date: Mon Sep 27 12:13:32 2010 >> New Revision: 1001698 > >> The following work remains: >> - Testing all connectors (HTTP and AJP) with TCK + security manager and >> fixing whatever is broken > > Just as soon as I get this done, I plan to roll a 7.0.3 release. > Hopefully this week although given how long it took me to get this > commit ready... Servlet TCK passes for all three HTTP connectors with a security manager. AJP connectors up next. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001871 - /tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java
Author: markt Date: Mon Sep 27 18:55:29 2010 New Revision: 1001871 URL: http://svn.apache.org/viewvc?rev=1001871&view=rev Log: CTR. Tabs -> 8 spaces. No functional change. Modified: tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java Modified: tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java?rev=1001871&r1=1001870&r2=1001871&view=diff == --- tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java (original) +++ tomcat/tc5.5.x/trunk/jasper/src/share/org/apache/jasper/compiler/TagFileProcessor.java Mon Sep 27 18:55:29 2010 @@ -255,11 +255,11 @@ class TagFileProcessor { if (nameFromAttribute != null) { /* -* An alias has been specified. We use 'nameGiven' to hold the -* value of the alias, and 'nameFromAttribute' to hold the -* name of the attribute whose value (at invocation-time) -* denotes the name of the variable that is being aliased -*/ + * An alias has been specified. We use 'nameGiven' to hold the + * value of the alias, and 'nameFromAttribute' to hold the + * name of the attribute whose value (at invocation-time) + * denotes the name of the variable that is being aliased + */ nameGiven = alias; checkUniqueName(nameFromAttribute, VAR_NAME_FROM, n); checkUniqueName(alias, VAR_ALIAS, n); @@ -293,13 +293,13 @@ class TagFileProcessor { return variableVector; } - /* -* Returns the value of the dynamic-attributes tag directive -* attribute. -*/ - public String getDynamicAttributesMapName() { - return dynamicAttrsMapName; - } +/* + * Returns the value of the dynamic-attributes tag directive + * attribute. + */ +public String getDynamicAttributesMapName() { +return dynamicAttrsMapName; +} public TagInfo getTagInfo() throws JasperException { @@ -323,17 +323,17 @@ class TagFileProcessor { attributeVector.copyInto(tagAttributeInfo); return new JasperTagInfo(name, - tagClassName, - bodycontent, - description, - tagLibInfo, - tei, - tagAttributeInfo, - displayName, - smallIcon, - largeIcon, - tagVariableInfos, - dynamicAttrsMapName); + tagClassName, + bodycontent, + description, + tagLibInfo, + tei, + tagAttributeInfo, + displayName, + smallIcon, + largeIcon, + tagVariableInfos, + dynamicAttrsMapName); } static class NameEntry { @@ -394,7 +394,7 @@ class TagFileProcessor { */ void postCheck() throws JasperException { // Check that var.name-from-attributes has valid values. - Iterator iter = nameFromTable.keySet().iterator(); +Iterator iter = nameFromTable.keySet().iterator(); while (iter.hasNext()) { String nameFrom = (String) iter.next(); NameEntry nameEntry = (NameEntry) nameTable.get(nameFrom); @@ -437,9 +437,9 @@ class TagFileProcessor { * See https://issues.apache.org/bugzilla/show_bug.cgi?id=46471 */ public static TagInfo parseTagFileDirectives(ParserController pc, -String name, -String path, -TagLibraryInfo tagLibInfo) + String name, + String path, + TagLibraryInfo tagLibInfo) throws JasperException { return parseTagFileDirectives(pc, name, path, (URL) pc.getJspCompilationContext().getTagFileJarUrls( @@ -530,10 +530,10 @@ class TagFileProcessor { tagFileJarUrl); rctxt.addWrapper(wrapperUri, wrapper);
svn commit: r1001880 - /tomcat/tc5.5.x/trunk/STATUS.txt
Author: markt Date: Mon Sep 27 19:14:45 2010 New Revision: 1001880 URL: http://svn.apache.org/viewvc?rev=1001880&view=rev Log: Proposal Modified: tomcat/tc5.5.x/trunk/STATUS.txt Modified: tomcat/tc5.5.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=1001880&r1=1001879&r2=1001880&view=diff == --- tomcat/tc5.5.x/trunk/STATUS.txt (original) +++ tomcat/tc5.5.x/trunk/STATUS.txt Mon Sep 27 19:14:45 2010 @@ -66,3 +66,9 @@ PATCHES PROPOSED TO BACKPORT: -- see attachment 25657 in BZ 49521, but I do not think that it is worth it.) jim: Also not comfortable with such a change this late in the game regarding default behavior of a stable branch. + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49935 + Handle compilation of recursive tag files. Port fix from tc6. + http://people.apache.org/~markt/patches/2010-09-27-bug49935-tc5.patch + +1: markt + -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49935] recursive tag calls don't work
https://issues.apache.org/bugzilla/show_bug.cgi?id=49935 --- Comment #4 from Mark Thomas 2010-09-27 15:15:32 EDT --- This was previously fixed in 6.0.x. I back-ported the relevant patches to 5.5.x and they do fix the issue. The combined patch has been proposed for 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
DO NOT REPLY [Bug 50015] New: dynamic servlet security incomplete and badly distributed
https://issues.apache.org/bugzilla/show_bug.cgi?id=50015 Summary: dynamic servlet security incomplete and badly distributed Product: Tomcat 7 Version: trunk Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: djen...@apache.org The current implementation of dynamic servlet security through ServletRegistration.Dynamic.setServletSecurity and the ServletContext.createServlet and addServlet methods is incomplete, and includes some logic that exposes internals of the tomcat security framework directly in the ServletRegistration.Dynamic implementation. The attached patch: - moves the logic that depends on the internals of tomcats security implementation from ApplicationServletRegistration to StandardContext where it can at least be overridden by e.g. jacc implementations - provides notifications to StandardContext of users calling createServlet and addServlet on ApplicationContext/ServletContext so subclasses of StandardContext can implement the spec behavior without subclassing ApplicationContext. This patch is generated from a tomcat copy that already has several other patches I've proposed applied. Let me know if there are problems applying it. -- 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 50015] dynamic servlet security incomplete and badly distributed
https://issues.apache.org/bugzilla/show_bug.cgi?id=50015 --- Comment #1 from david jencks 2010-09-27 16:24:07 EDT --- Created an attachment (id=26088) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26088) patch for improved dynamic servlet security implementations -- 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: r1001899 - in /tomcat/trunk/java/org/apache/catalina/ant: AbstractCatalinaTask.java ValidatorTask.java jmx/JMXAccessorQueryTask.java jmx/JMXAccessorTask.java
Author: markt Date: Mon Sep 27 20:24:18 2010 New Revision: 1001899 URL: http://svn.apache.org/viewvc?rev=1001899&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Don't catch Throwable Modified: tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java Modified: tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff == --- tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/AbstractCatalinaTask.java Mon Sep 27 20:24:18 2010 @@ -20,6 +20,7 @@ package org.apache.catalina.ant; import java.io.BufferedOutputStream; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.net.HttpURLConnection; @@ -262,27 +263,27 @@ public abstract class AbstractCatalinaTa // or error line will be logged twice throw new BuildException(error); } -} catch (Throwable t) { +} catch (Exception e) { if (isFailOnError()) { -throw new BuildException(t); +throw new BuildException(e); } else { -handleErrorOutput(t.getMessage()); +handleErrorOutput(e.getMessage()); } } finally { closeRedirector(); if (reader != null) { try { reader.close(); -} catch (Throwable u) { -ExceptionUtils.handleThrowable(u); +} catch (IOException ioe) { +// Ignore } reader = null; } if (istream != null) { try { istream.close(); -} catch (Throwable u) { -ExceptionUtils.handleThrowable(u); +} catch (IOException ioe) { +// Ignore } istream = null; } Modified: tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff == --- tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/ValidatorTask.java Mon Sep 27 20:24:18 2010 @@ -100,11 +100,11 @@ public class ValidatorTask extends BaseR is.setByteStream(stream); digester.parse(is); handleOutput("web.xml validated"); -} catch (Throwable t) { +} catch (Exception e) { if (isFailOnError()) { -throw new BuildException("Validation failure", t); +throw new BuildException("Validation failure", e); } else { -handleErrorOutput("Validation failure: " + t); +handleErrorOutput("Validation failure: " + e); } } finally { Thread.currentThread().setContextClassLoader(oldCL); Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java?rev=1001899&r1=1001898&r2=1001899&view=diff == --- tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java (original) +++ tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorQueryTask.java Mon Sep 27 20:24:18 2010 @@ -196,11 +196,11 @@ public class JMXAccessorQueryTask extend try { value = jmxServerConnection .getAttribute(oname, attName); -} catch (Throwable t) { +} catch (Exception e) { if (isEcho()) handleErrorOutput("Error getting attribute " + oname + " " + pname + attName + " " -+ t.toString()); ++ e.toString()); continue; } if (value == null) Modified: tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ant/jmx/JMXAccessorTask.java?rev=1001899&r1=1001898&r
Re: Atomicity violation in removeAttribute
> If get() cannot return null, then I think one can just use: > value = attributes.remove(name); > if (value == null) > return; > If it is important to distinguish null entries from missing entries, > then a different approach is needed - e.g. AtomicReference as > suggested elsewhere ConcurrentHashMap does not support null keys and entries. I would use: if (attributes.containsKey(name)) { value = attributes.remove(name); if (value == null) return; } else { return; } because containsKey does not acquire a lock while remove does. Could you please let me know whether you consider this as a bug? Thx, Ohad On Mon, Sep 27, 2010 at 12:04 PM, sebb wrote: > On 26 September 2010 15:00, Ohad Shacham wrote: > > Hi, > > > > > > In addition to the behavior we experienced in function setAttribute. We > also > > experienced another atomicity violation in function removeAttribute. > > > > The following code is located at the beginning of function > removeAttribute > > at class ApplicationContext. This code fragment intends to check whether > a > > key is already inside the “attributes” collection. If it does, then the > key > > is removed from the collection and the function continues running while > > assigning the corresponding value to “value”. Otherwise, the function > should > > return. > > > > > > > > > > found = attributes.containsKey(name); > > > > if (found) { > > > > value = attributes.get(name); > > > >attributes.remove(name); > > > > } else { > > > > return; > > > > } > > > > > > > > This code can behave non atomically when two different threads call > > removeAttribute function with the same attribute name. In this case, > there > > exists a thread interleaving where two threads enter the “if” condition > > while the first one removes “name” from the attributes collection before > the > > second one runs the get operation. This causes the function to continue > > running with value == null instead of returning. > > > > > > > > Could you please let me know whether you consider this as a bug? > > > > > > > > A possible way of modifying the code in order to execute this code > > atomically is as follows: > > > > > > > > if (attributes.containsKey(name)) { > >value = attributes.remove(name); > >if (value == null) > >return; > > } > > That's not quite the same if atttributes.get() can return null, as > previously the null would be used in subsequent code. > > If get() cannot return null, then I think one can just use: > > value = attributes.remove(name); > if (value == null) > return; > > If it is important to distinguish null entries from missing entries, > then a different approach is needed - e.g. AtomicReference as > suggested elsewhere > > > > > > > Thanks, > > > > Ohad > > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
RE: Atomicity violation in removeAttribute
> From: ohad.shac...@gmail.com [mailto:ohad.shac...@gmail.com] On Behalf Of > Ohad Shacham > Subject: Re: Atomicity violation in removeAttribute > I would use: > if (attributes.containsKey(name)) { > value = attributes.remove(name); > if (value == null) > return; > } > else { > return; > } In what way is that an improvement? ConcurrentHashMap.remove() returns null when the key cannot be found; why add the redundant call to contansKey()? - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001904 - in /tomcat/trunk/java/org/apache/catalina: authenticator/ connector/ core/
Author: markt Date: Mon Sep 27 20:52:49 2010 New Revision: 1001904 URL: http://svn.apache.org/viewvc?rev=1001904&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java tomcat/trunk/java/org/apache/catalina/connector/Request.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContext.java tomcat/trunk/java/org/apache/catalina/core/ApplicationContextFacade.java tomcat/trunk/java/org/apache/catalina/core/ApplicationDispatcher.java tomcat/trunk/java/org/apache/catalina/core/ApplicationFilterChain.java tomcat/trunk/java/org/apache/catalina/core/AprLifecycleListener.java tomcat/trunk/java/org/apache/catalina/core/ContainerBase.java tomcat/trunk/java/org/apache/catalina/core/DefaultInstanceManager.java tomcat/trunk/java/org/apache/catalina/core/JasperListener.java tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/core/StandardContextValve.java tomcat/trunk/java/org/apache/catalina/core/StandardHost.java tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java tomcat/trunk/java/org/apache/catalina/core/StandardServer.java tomcat/trunk/java/org/apache/catalina/core/StandardWrapper.java tomcat/trunk/java/org/apache/catalina/core/StandardWrapperValve.java Modified: tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java?rev=1001904&r1=1001903&r2=1001904&view=diff == --- tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java (original) +++ tomcat/trunk/java/org/apache/catalina/authenticator/FormAuthenticator.java Mon Sep 27 20:52:49 2010 @@ -36,6 +36,7 @@ import org.apache.catalina.Session; import org.apache.catalina.connector.Request; import org.apache.catalina.deploy.LoginConfig; import org.apache.coyote.ActionCode; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.buf.ByteChunk; @@ -322,6 +323,7 @@ public class FormAuthenticator try { disp.forward(request.getRequest(), response); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); String msg = sm.getString("formAuthenticator.forwardLoginFail"); log.warn(msg, t); request.setAttribute(Globals.EXCEPTION_ATTR, t); @@ -351,6 +353,7 @@ public class FormAuthenticator try { disp.forward(request.getRequest(), response); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); String msg = sm.getString("formAuthenticator.forwardErrorFail"); log.warn(msg, t); request.setAttribute(Globals.EXCEPTION_ATTR, t); Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=1001904&r1=1001903&r2=1001904&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Mon Sep 27 20:52:49 2010 @@ -34,6 +34,7 @@ import org.apache.catalina.util.ServerIn import org.apache.catalina.util.URLEncoder; import org.apache.coyote.ActionCode; import org.apache.coyote.Adapter; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.buf.B2CConverter; @@ -233,6 +234,7 @@ public class CoyoteAdapter implements Ad } return (!error); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); if (!(t instanceof IOException)) { log.error(sm.getString("coyoteAdapter.service"), t); } @@ -306,6 +308,7 @@ public class CoyoteAdapter implements Ad success = false; // Ignore } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); success = false; log.error(sm.getString("coyoteAdapter.service"), t); } finally { @@ -406,6 +409,7 @@ public class CoyoteAdapter implements Ad } catch (IOException e) { // Ignore } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error(sm.getString("coyoteAdapter.service"), t); } finally { req.getRequestProcessor().setWorkerThreadName(null); Modified: tomca
DO NOT REPLY [Bug 50016] New: bad division of responsibility around isUserInRole and new Request login and logout methods
https://issues.apache.org/bugzilla/show_bug.cgi?id=50016 Summary: bad division of responsibility around isUserInRole and new Request login and logout methods Product: Tomcat 7 Version: trunk Platform: PC Status: NEW Severity: normal Priority: P2 Component: Catalina AssignedTo: dev@tomcat.apache.org ReportedBy: djen...@apache.org Created an attachment (id=26089) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26089) improve division of responsibility for isUserInRole and login/logout methods There are 2 similar problems that have a bad division of responsibility. 1. Request.isUserInRole tries to prevent jacc implementations and is also wrong. In the current tomcat implementation, role-ref mappings are first applied to the supplied role and then the target role is tested. If the user is not in the mapped role the original role is tested. However, (a). jacc requires that this be implemented by constructing a role-ref permission with the current servlet name and the supplied (not mapped) role. So to be reasonably amenable to a jacc implementation Request.isUserInRole should supply the original role and if possible the servlet name to the wrapper. (b) if there is a mapping, only the mapped role should be checked. Aside from the spec language, consider a web app with two roles A and B and a servlet S that maps A to B and B to A. A user that logs in and is in role A and not B should be able to test in S is in A >> false is in B >> true The current implementation reports true for both A and B. 2. The implementation of the new login and logout methods are excessively intrusive into the internals of the authentication. Both should be delegated directly to the Authenticator. In particular, checking which known Authenticator is installed to see if it supports user/pw login is overly restrictive since other authenticators might be installed. The authenticator also ought to be able to decide if it wants to cache the authentication results. -- 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: Atomicity violation in removeAttribute
On 27 September 2010 21:34, Ohad Shacham wrote: > ConcurrentHashMap does not support null keys and entries. Did not check that. However, the attributes Map field is protected and not final, so it could in theory be replaced with a Map that allows dupes. That's perhaps another bug... - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1001698 [1/2] - in /tomcat/trunk: java/org/apache/catalina/connector/ java/org/apache/catalina/core/ java/org/apache/catalina/security/ java/org/apache/coyote/ java/org/apache/coyote/
I'd really appreciate your taking a look at the following issues before 7.0.3, in this order of priority. 49952 ServletContainerInitializer can't actually add listeners this is an obvious bug with a simple fix and a new testcase. 50015 dynamic servlet security incomplete and badly distributed There's some major application logic in ApplicationServletRegistration and there aren't enough notifications to StandardContext for createServlet and addServlet calls to ServletContext to easily implement the spec required behavior for @ServletSecurity annotation scanning for dynamically added servlets. This patch doesn't implement much missing behavior but puts in some methods in ServletContext that allow subclasses to implement the spec behavior easily. If someone expresses some interest and there are a couple days I could try to provide a tomcat implementation of the missing beahvior. 50016 bad division of responsibility around isUserInRole and new Request login and logout methods There's some code in Request that I think should be in Realm, the authenticators, or Wrapper. 49916 use an init-param for jspFile on explicit jsp servlets This provides what I think is a significant code simplification and has a better division of responsibility for proecessing and running jsps. 49937 Problems with AsyncListener and resource injection This one is probably controversial since the spec is contradictory on the subject. thanks david jencks On Sep 27, 2010, at 5:16 AM, Mark Thomas wrote: > On 27/09/2010 13:13, ma...@apache.org wrote: >> Author: markt >> Date: Mon Sep 27 12:13:32 2010 >> New Revision: 1001698 > >> The following work remains: >> - Testing all connectors (HTTP and AJP) with TCK + security manager and >> fixing whatever is broken > > Just as soon as I get this done, I plan to roll a 7.0.3 release. > Hopefully this week although given how long it took me to get this > commit ready... > > Mark > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org >
svn commit: r1001915 - in /tomcat/trunk/java/org/apache/catalina: deploy/ ha/authenticator/ ha/session/ loader/ manager/ manager/host/
Author: markt Date: Mon Sep 27 21:32:25 2010 New Revision: 1001915 URL: http://svn.apache.org/viewvc?rev=1001915&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/trunk/java/org/apache/catalina/loader/WebappLoader.java tomcat/trunk/java/org/apache/catalina/manager/HTMLManagerServlet.java tomcat/trunk/java/org/apache/catalina/manager/JMXProxyServlet.java tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java tomcat/trunk/java/org/apache/catalina/manager/host/HostManagerServlet.java Modified: tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java?rev=1001915&r1=1001914&r2=1001915&view=diff == --- tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java (original) +++ tomcat/trunk/java/org/apache/catalina/deploy/ErrorPage.java Mon Sep 27 21:32:25 2010 @@ -92,7 +92,7 @@ public class ErrorPage implements Serial try { this.errorCode = Integer.parseInt(errorCode); -} catch (Throwable t) { +} catch (NumberFormatException nfe) { this.errorCode = 0; } Modified: tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java?rev=1001915&r1=1001914&r2=1001915&view=diff == --- tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java (original) +++ tomcat/trunk/java/org/apache/catalina/ha/authenticator/ClusterSingleSignOn.java Mon Sep 27 21:32:25 2010 @@ -32,6 +32,7 @@ import org.apache.catalina.authenticator import org.apache.catalina.ha.CatalinaCluster; import org.apache.catalina.ha.ClusterManager; import org.apache.catalina.util.LifecycleBase; +import org.apache.jasper.util.ExceptionUtils; @@ -149,6 +150,7 @@ public class ClusterSingleSignOn "There is no Cluster for ClusterSingleSignOn"); } } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); throw new LifecycleException( "ClusterSingleSignOn exception during clusterLoad " + t); } Modified: tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=1001915&r1=1001914&r2=1001915&view=diff == --- tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java (original) +++ tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java Mon Sep 27 21:32:25 2010 @@ -787,6 +787,7 @@ public class DeltaManager extends Cluste getAllClusterSessions(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error(sm.getString("deltaManager.managerLoad"), t); } 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=1001915&r1=1001914&r2=1001915&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Mon Sep 27 21:32:25 2010 @@ -70,6 +70,7 @@ import org.apache.catalina.LifecycleExce import org.apache.catalina.LifecycleListener; import org.apache.catalina.LifecycleState; import org.apache.jasper.servlet.JasperLoader; +import org.apache.jasper.util.ExceptionUtils; import org.apache.naming.JndiPermission; import org.apache.naming.resources.ProxyDirContext; import org.apache.naming.resources.Resource; @@ -2105,6 +2106,7 @@ public class WebappClassLoader } } } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); if (log.isDebugEnabled()) { log.debug("Could not set field " + field.getName() + " to null in class " + clazz.getName(), t); @@ -2113,6 +2115,7 @@ public class WebappClassLoader } }
svn commit: r1001923 - in /tomcat/trunk/java/org/apache/catalina: mbeans/ realm/ session/ startup/ tribes/membership/ tribes/transport/nio/ util/ valves/
Author: markt Date: Mon Sep 27 22:01:45 2010 New Revision: 1001923 URL: http://svn.apache.org/viewvc?rev=1001923&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java tomcat/trunk/java/org/apache/catalina/realm/JDBCRealm.java tomcat/trunk/java/org/apache/catalina/realm/UserDatabaseRealm.java tomcat/trunk/java/org/apache/catalina/session/StandardManager.java tomcat/trunk/java/org/apache/catalina/session/StandardSession.java tomcat/trunk/java/org/apache/catalina/startup/Bootstrap.java tomcat/trunk/java/org/apache/catalina/startup/Catalina.java tomcat/trunk/java/org/apache/catalina/startup/CatalinaProperties.java tomcat/trunk/java/org/apache/catalina/startup/ContextConfig.java tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java tomcat/trunk/java/org/apache/catalina/startup/TldConfig.java tomcat/trunk/java/org/apache/catalina/startup/Tool.java tomcat/trunk/java/org/apache/catalina/tribes/membership/McastServiceImpl.java tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java tomcat/trunk/java/org/apache/catalina/util/CharsetMapper.java tomcat/trunk/java/org/apache/catalina/util/ServerInfo.java tomcat/trunk/java/org/apache/catalina/valves/AccessLogValve.java tomcat/trunk/java/org/apache/catalina/valves/ErrorReportValve.java tomcat/trunk/java/org/apache/catalina/valves/ExtendedAccessLogValve.java tomcat/trunk/java/org/apache/catalina/valves/JDBCAccessLogValve.java Modified: tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java?rev=1001923&r1=1001922&r2=1001923&view=diff == --- tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java (original) +++ tomcat/trunk/java/org/apache/catalina/mbeans/MBeanUtils.java Mon Sep 27 22:01:45 2010 @@ -1072,6 +1072,7 @@ public class MBeanUtils { try { mserver = Registry.getRegistry(null, null).getMBeanServer(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); t.printStackTrace(System.out); System.exit(1); } Modified: tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java?rev=1001923&r1=1001922&r2=1001923&view=diff == --- tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java (original) +++ tomcat/trunk/java/org/apache/catalina/mbeans/ServerLifecycleListener.java Mon Sep 27 22:01:45 2010 @@ -48,6 +48,7 @@ import org.apache.catalina.deploy.Contex import org.apache.catalina.deploy.ContextResource; import org.apache.catalina.deploy.ContextResourceLink; import org.apache.catalina.deploy.NamingResources; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -150,9 +151,8 @@ public class ServerLifecycleListener log.error("createMBeans: MBeanException", e); } catch (Throwable t) { - +ExceptionUtils.handleThrowable(t); log.error("createMBeans: Throwable", t); - } /* @@ -180,9 +180,8 @@ public class ServerLifecycleListener log.error("destroyMBeans: MBeanException", e); } catch (Throwable t) { - +ExceptionUtils.handleThrowable(t); log.error("destroyMBeans: Throwable", t); - } // FIXME: RMI adaptor should be stopped; however, this is // undocumented in MX4J, and reports exist in the MX4J bug DB that @@ -925,6 +924,7 @@ public class ServerLifecycleListener e = t; log.error("processContainerAddChild: MBeanException", e); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error("processContainerAddChild: Throwable", t); } @@ -1060,6 +1060,7 @@ public class ServerLifecycleListener e = t; log.error("processContainerRemoveChild: MBeanException", e); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error("processContainerRemoveChild: Throwable", t); } Modified: tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/JAASRealm.java?rev=1001923&r1=1001922&r2=
svn commit: r1001932 - in /tomcat/trunk/java/org/apache/coyote: ajp/ http11/
Author: markt Date: Mon Sep 27 22:12:05 2010 New Revision: 1001932 URL: http://svn.apache.org/viewvc?rev=1001932&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProcessor.java tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/Http11AprProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProcessor.java tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java tomcat/trunk/java/org/apache/coyote/http11/Http11Processor.java tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java?rev=1001932&r1=1001931&r2=1001932&view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProcessor.java Mon Sep 27 22:12:05 2010 @@ -34,6 +34,7 @@ import org.apache.coyote.OutputBuffer; import org.apache.coyote.Request; import org.apache.coyote.RequestInfo; import org.apache.coyote.Response; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.jni.Socket; @@ -409,6 +410,7 @@ public class AjpAprProcessor implements error = true; break; } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.debug(sm.getString("ajpprocessor.header.error"), t); // 400 - Bad Request response.setStatus(400); @@ -421,6 +423,7 @@ public class AjpAprProcessor implements try { prepareRequest(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.debug(sm.getString("ajpprocessor.request.prepare"), t); // 400 - Internal Server Error response.setStatus(400); @@ -436,6 +439,7 @@ public class AjpAprProcessor implements } catch (InterruptedIOException e) { error = true; } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error(sm.getString("ajpprocessor.request.process"), t); // 500 - Internal Server Error response.setStatus(500); @@ -453,6 +457,7 @@ public class AjpAprProcessor implements try { finish(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); error = true; } } @@ -498,6 +503,7 @@ public class AjpAprProcessor implements } catch (InterruptedIOException e) { error = true; } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); log.error(sm.getString("http11processor.request.process"), t); // 500 - Internal Server Error response.setStatus(500); Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1001932&r1=1001931&r2=1001932&view=diff == --- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original) +++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Mon Sep 27 22:12:05 2010 @@ -36,6 +36,7 @@ import org.apache.coyote.Adapter; import org.apache.coyote.ProtocolHandler; import org.apache.coyote.RequestGroupInfo; import org.apache.coyote.RequestInfo; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; import org.apache.tomcat.util.modeler.Registry; @@ -420,6 +421,7 @@ public class AjpAprProtocol // rare-but-nonfatal exceptions, catch them here, and log as // above. catch (Throwable e) { +ExceptionUtils.handleThrowable(e); // any other exception or error is odd. Here we log it // with "ERROR" level, so it will show up even on // less-than-verbose logs. @@ -456,6 +458,7 @@ public class AjpAprProtocol // rare-but-nonfatal exceptions, catch them here, and log as // above. catc
svn commit: r1001933 - in /tomcat/trunk/java/org/apache/jasper: compiler/ runtime/ servlet/
Author: markt Date: Mon Sep 27 22:16:26 2010 New Revision: 1001933 URL: http://svn.apache.org/viewvc?rev=1001933&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java tomcat/trunk/java/org/apache/jasper/compiler/ParserController.java tomcat/trunk/java/org/apache/jasper/compiler/TagLibraryInfoImpl.java tomcat/trunk/java/org/apache/jasper/compiler/TldLocationsCache.java tomcat/trunk/java/org/apache/jasper/runtime/JspFactoryImpl.java tomcat/trunk/java/org/apache/jasper/servlet/JspCServletContext.java tomcat/trunk/java/org/apache/jasper/servlet/JspServlet.java tomcat/trunk/java/org/apache/jasper/servlet/JspServletWrapper.java Modified: tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java?rev=1001933&r1=1001932&r2=1001933&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/ImplicitTagLibraryInfo.java Mon Sep 27 22:16:26 2010 @@ -31,6 +31,7 @@ import javax.servlet.jsp.tagext.TagLibra import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; +import org.apache.jasper.util.ExceptionUtils; import org.apache.jasper.xmlparser.ParserUtils; import org.apache.jasper.xmlparser.TreeNode; @@ -164,6 +165,7 @@ class ImplicitTagLibraryInfo extends Tag try { in.close(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); } } } Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java?rev=1001933&r1=1001932&r2=1001933&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspReader.java Mon Sep 27 22:16:26 2010 @@ -27,6 +27,7 @@ import java.util.jar.JarFile; import org.apache.jasper.JasperException; import org.apache.jasper.JspCompilationContext; +import org.apache.jasper.util.ExceptionUtils; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -570,6 +571,7 @@ class JspReader { longName, encoding); } } catch (Throwable ex) { +ExceptionUtils.handleThrowable(ex); log.error("Exception parsing file ", ex); // Pop state being constructed: popFile(); Modified: tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java?rev=1001933&r1=1001932&r2=1001933&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/JspRuntimeContext.java Mon Sep 27 22:16:26 2010 @@ -40,6 +40,7 @@ import org.apache.jasper.Options; import org.apache.jasper.runtime.JspFactoryImpl; import org.apache.jasper.security.SecurityClassLoad; import org.apache.jasper.servlet.JspServletWrapper; +import org.apache.jasper.util.ExceptionUtils; import org.apache.jasper.util.JspQueue; import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; @@ -338,6 +339,7 @@ public final class JspRuntimeContext { } catch (FileNotFoundException ex) { ctxt.incrementRemoved(); } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); jsw.getServletContext().log("Background compile failed", t); } Modified: tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java?rev=1001933&r1=1001932&r2=1001933&view=diff == --- tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java (original) +++ tomcat/trunk/java/org/apache/jasper/compiler/Localizer.java Mon Sep 27 22:16:26 2010 @@ -21,6 +21,8 @@ import java.text.MessageFormat; import java
svn commit: r1001934 - in /tomcat/trunk/java/org/apache/juli: ClassLoaderLogManager.java OneLineFormatter.java
Author: markt Date: Mon Sep 27 22:17:30 2010 New Revision: 1001934 URL: http://svn.apache.org/viewvc?rev=1001934&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java tomcat/trunk/java/org/apache/juli/OneLineFormatter.java Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1001934&r1=1001933&r2=1001934&view=diff == --- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original) +++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Mon Sep 27 22:17:30 2010 @@ -488,7 +488,9 @@ public class ClassLoaderLogManager exten } finally { try { is.close(); -} catch (Throwable t) {} +} catch (IOException ioe) { +// Ignore +} } // Create handlers for the root logger of this classloader Modified: tomcat/trunk/java/org/apache/juli/OneLineFormatter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/juli/OneLineFormatter.java?rev=1001934&r1=1001933&r2=1001934&view=diff == --- tomcat/trunk/java/org/apache/juli/OneLineFormatter.java (original) +++ tomcat/trunk/java/org/apache/juli/OneLineFormatter.java Mon Sep 27 22:17:30 2010 @@ -119,7 +119,7 @@ public class OneLineFormatter extends Fo int index; try { index = Integer.parseInt(month) - 1; -} catch (Throwable t) { +} catch (Exception e) { index = 0; // Can not happen, in theory } return (months[index]); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001938 - in /tomcat/trunk/java/org/apache/naming: NamingService.java factory/ResourceFactory.java factory/webservices/ServiceRefFactory.java
Author: markt Date: Mon Sep 27 22:22:02 2010 New Revision: 1001938 URL: http://svn.apache.org/viewvc?rev=1001938&view=rev Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/naming/NamingService.java tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java Modified: tomcat/trunk/java/org/apache/naming/NamingService.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/NamingService.java?rev=1001938&r1=1001937&r2=1001938&view=diff == --- tomcat/trunk/java/org/apache/naming/NamingService.java (original) +++ tomcat/trunk/java/org/apache/naming/NamingService.java Mon Sep 27 22:22:02 2010 @@ -156,7 +156,7 @@ public final class NamingService + ".java.javaURLContextFactory"); } -} catch (Throwable t) { +} catch (Exception e) { state = STOPPED; notification = new AttributeChangeNotification (this, sequenceNumber++, System.currentTimeMillis(), @@ -198,11 +198,9 @@ public final class NamingService System.setProperty(Context.URL_PKG_PREFIXES, oldUrlValue); System.setProperty(Context.INITIAL_CONTEXT_FACTORY, oldIcValue); -} catch (Throwable t) { - +} catch (Exception e) { // FIXME -t.printStackTrace(); - +e.printStackTrace(); } state = STOPPED; Modified: tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java?rev=1001938&r1=1001937&r2=1001938&view=diff == --- tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java (original) +++ tomcat/trunk/java/org/apache/naming/factory/ResourceFactory.java Mon Sep 27 22:22:02 2010 @@ -98,12 +98,12 @@ public class ResourceFactory if (factoryClass != null) { try { factory = (ObjectFactory) factoryClass.newInstance(); -} catch (Throwable t) { -if (t instanceof NamingException) -throw (NamingException) t; +} catch (Exception e) { +if (e instanceof NamingException) +throw (NamingException) e; NamingException ex = new NamingException ("Could not create resource factory instance"); -ex.initCause(t); +ex.initCause(e); throw ex; } } @@ -116,10 +116,10 @@ public class ResourceFactory factory = (ObjectFactory) Class.forName(javaxSqlDataSourceFactoryClassName) .newInstance(); -} catch (Throwable t) { +} catch (Exception e) { NamingException ex = new NamingException ("Could not create resource factory instance"); -ex.initCause(t); +ex.initCause(e); throw ex; } } else if (ref.getClassName().equals("javax.mail.Session")) { Modified: tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java?rev=1001938&r1=1001937&r2=1001938&view=diff == --- tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java (original) +++ tomcat/trunk/java/org/apache/naming/factory/webservices/ServiceRefFactory.java Mon Sep 27 22:22:02 2010 @@ -143,10 +143,10 @@ public class ServiceRefFactory service = factory.createService( new URL(wsdlRefAddr), serviceQname ); } -} catch (Throwable t) { +} catch (Exception e) { NamingException ex = new NamingException ("Could not create service"); -ex.initCause(t); +ex.initCause(e); throw ex; } } else { @@ -175,10 +175,10 @@ public class ServiceRefFactory serviceInterfaceClass, new Properties() ); } -} catch (
svn commit: r1001939 - in /tomcat/trunk/java/org/apache/tomcat: jni/ util/digester/ util/http/fileupload/ util/http/fileupload/util/ util/net/
Author: markt Date: Mon Sep 27 22:29:30 2010 New Revision: 1001939 URL: http://svn.apache.org/viewvc?rev=1001939&view=rev Log: Remaining fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Some Throwables must always be re-thrown Modified: tomcat/trunk/java/org/apache/tomcat/jni/Library.java tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java tomcat/trunk/java/org/apache/tomcat/util/net/NioBlockingSelector.java tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Modified: tomcat/trunk/java/org/apache/tomcat/jni/Library.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/jni/Library.java?rev=1001939&r1=1001938&r2=1001939&view=diff == --- tomcat/trunk/java/org/apache/tomcat/jni/Library.java (original) +++ tomcat/trunk/java/org/apache/tomcat/jni/Library.java Mon Sep 27 22:29:30 2010 @@ -17,6 +17,8 @@ package org.apache.tomcat.jni; +import org.apache.tomcat.util.ExceptionUtils; + /** Library * * @author Mladen Turk @@ -43,6 +45,7 @@ public final class Library { loaded = true; } catch (Throwable e) { +ExceptionUtils.handleThrowable(e); String name = System.mapLibraryName(NAMES[i]); String path = System.getProperty("java.library.path"); String sep = System.getProperty("path.separator"); Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=1001939&r1=1001938&r2=1001939&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Mon Sep 27 22:29:30 2010 @@ -37,6 +37,7 @@ import javax.xml.parsers.SAXParserFactor import org.apache.juli.logging.Log; import org.apache.juli.logging.LogFactory; +import org.apache.tomcat.util.ExceptionUtils; import org.apache.tomcat.util.IntrospectionUtils; import org.xml.sax.Attributes; import org.xml.sax.EntityResolver; @@ -100,6 +101,7 @@ public class Digester extends DefaultHan sources[0] = src; initialized = true; } catch (Throwable t) { +ExceptionUtils.handleThrowable(t); LogFactory.getLog("org.apache.commons.digester.Digester"). error("Unable to load property source["+className+"].",t); } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java?rev=1001939&r1=1001938&r2=1001939&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileUploadBase.java Mon Sep 27 22:29:30 2010 @@ -340,7 +340,7 @@ public abstract class FileUploadBase { FileItem fileItem = iterator.next(); try { fileItem.delete(); -} catch (Throwable e) { +} catch (Exception e) { // ignore it } } Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java?rev=1001939&r1=1001938&r2=1001939&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/util/Streams.java Mon Sep 27 22:29:30 2010 @@ -119,14 +119,14 @@ public final class Streams { if (in != null) { try { in.close(); -} catch (Throwable t) { +} catch (IOException ioe) { /* Ignore me */ } } if (pClose && out != null) { try { out.close(); -} catch (Throwable t) { +} catch (IOException ioe) { /* Ignore me */ } } Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL:
svn commit: r1001941 - /tomcat/trunk/webapps/docs/changelog.xml
Author: markt Date: Mon Sep 27 22:31:03 2010 New Revision: 1001941 URL: http://svn.apache.org/viewvc?rev=1001941&view=rev Log: Update 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=1001941&r1=1001940&r2=1001941&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Mon Sep 27 22:31:03 2010 @@ -39,6 +39,10 @@ + +48644: Review all instances of catching Throwable and +re-throw where appropriate. (markt) + Allow glob patterns in the jarsToSkip configuration and add some debug logging to the jar scanner. (rjung) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 48644] Code should never ignore throwable
https://issues.apache.org/bugzilla/show_bug.cgi?id=48644 Mark Thomas changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Comment #5 from Mark Thomas 2010-09-27 18:32:06 EDT --- Fixed in 7.0.x. Will be in 7.0.3 onwards. There are almost certainly some places where Throwable could be replaced with a more specific exception. Those can be handled as separate enhancement requests. -- 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 48827] Error validating empty tag that contains jsp:attribute in JSP documents in XML syntax
https://issues.apache.org/bugzilla/show_bug.cgi?id=48827 Mark Thomas changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution||FIXED --- Comment #6 from Mark Thomas 2010-09-27 19:01:17 EDT --- I have review the EBNF in the JSP 2.2 spec and I can't see anything that would permit comments in a tag that should have an empty body. -- 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: r1001955 - /tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java
Author: markt Date: Mon Sep 27 23:06:08 2010 New Revision: 1001955 URL: http://svn.apache.org/viewvc?rev=1001955&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49209 Prevent possible AccessControlException during undeployment when running with a security manager Patch provided by Sylvain Laurent Modified: tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java 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=1001955&r1=1001954&r2=1001955&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Mon Sep 27 23:06:08 2010 @@ -2022,7 +2022,7 @@ public class WebappClassLoader } Class lpClass = defineClass("org.apache.catalina.loader.JdbcLeakPrevention", -classBytes, 0, offset); +classBytes, 0, offset, this.getClass().getProtectionDomain()); Object obj = lpClass.newInstance(); @SuppressWarnings("unchecked") // clearJdbcDriverRegistrations() returns List List driverNames = (List) obj.getClass().getMethod( - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1001956 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: markt Date: Mon Sep 27 23:08:03 2010 New Revision: 1001956 URL: http://svn.apache.org/viewvc?rev=1001956&view=rev Log: Proposal Modified: tomcat/tc6.0.x/trunk/STATUS.txt Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=1001956&r1=1001955&r2=1001956&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Sep 27 23:08:03 2010 @@ -157,3 +157,10 @@ PATCHES PROPOSED TO BACKPORT: kfujino : mapOwner is specified by the argument of the constructor of AbstractReplicatedMap. LazyReplicatedMap is constructed specifying "this" in BackupManager#startInternal(). Therefore, I think mapOwner can not be null. + +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=49209 + Prevent possible AccessControlException during undeployment when running with a security manager + Patch provided by Sylvain Laurent + http://svn.apache.org/viewvc?rev=1001955&view=rev + +1: markt + -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 49209] AccessControlException when undeploying application
https://issues.apache.org/bugzilla/show_bug.cgi?id=49209 --- Comment #8 from Mark Thomas 2010-09-27 19:08:18 EDT --- Thanks for the patch. Fixed in trunk and proposed for 6.0.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
svn commit: r1001958 - /tomcat/trunk/webapps/docs/changelog.xml
Author: markt Date: Mon Sep 27 23:09:54 2010 New Revision: 1001958 URL: http://svn.apache.org/viewvc?rev=1001958&view=rev Log: Update 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=1001958&r1=1001957&r2=1001958&view=diff == --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Mon Sep 27 23:09:54 2010 @@ -53,6 +53,11 @@ provided by Jiong Wang. (markt) +49209: Prevent possible AccessControlException during +undeployment when running with a security manager. Patch provided by +Sylvain Laurent. + + 49670: Restore SSO functionality that was broken by Lifecycle refactoring. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
DO NOT REPLY [Bug 50017] New: Make private immutable fields final
https://issues.apache.org/bugzilla/show_bug.cgi?id=50017 Summary: Make private immutable fields final Product: Tomcat 7 Version: trunk Platform: PC OS/Version: Windows XP Status: NEW Severity: normal Priority: P2 Component: Servlet & JSP API AssignedTo: dev@tomcat.apache.org ReportedBy: s...@apache.org Created an attachment (id=26090) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26090) Patch java.el package Patches to make immutable private fields final. -- 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 50017] Make private immutable fields final
https://issues.apache.org/bugzilla/show_bug.cgi?id=50017 Sebb changed: What|Removed |Added Attachment #26090|Patch java.el package |Patch javax.el package description|| -- 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 50017] Make private immutable fields final
https://issues.apache.org/bugzilla/show_bug.cgi?id=50017 --- Comment #1 from Sebb 2010-09-27 20:28:14 EDT --- Created an attachment (id=26091) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26091) Patch javax.servlet package -- 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 50018] New: Javadoc corrections
https://issues.apache.org/bugzilla/show_bug.cgi?id=50018 Summary: Javadoc corrections Product: Tomcat 7 Version: trunk Platform: PC OS/Version: Windows XP Status: NEW Severity: minor Priority: P2 Component: Jasper AssignedTo: dev@tomcat.apache.org ReportedBy: s...@apache.org Created an attachment (id=26092) --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26092) Javadoc corrections -- 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