svn commit: r1479061 - /tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java
Author: markt Date: Sat May 4 09:09:39 2013 New Revision: 1479061 URL: http://svn.apache.org/r1479061 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54926 Re-order the validation checks. Order is now: - Is this a WebSocket upgrade? - Is there a matching endpoint? - Validate remaining headers Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java Modified: tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java?rev=1479061&r1=1479060&r2=1479061&view=diff == --- tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java (original) +++ tomcat/trunk/java/org/apache/tomcat/websocket/server/WsFilter.java Sat May 4 09:09:39 2013 @@ -85,11 +85,29 @@ public class WsFilter implements Filter } // HTTP request with an upgrade header for WebSocket present -// Validate the rest of the headers and reject the request if that -// validation fails HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; +// Check to see if this WebSocket implementation has a matching mapping +WsServerContainer sc = WsServerContainer.getServerContainer(); +String path; +String pathInfo = req.getPathInfo(); +if (pathInfo == null) { +path = req.getServletPath(); +} else { +path = req.getServletPath() + pathInfo; +} +WsMappingResult mappingResult = sc.findMapping(path); + +if (mappingResult == null) { +// No endpoint registered for the requested path. Let the +// application handle it (it might redirect or forward for example) +chain.doFilter(request, response); +return; +} + +// Validate the rest of the headers and reject the request if that +// validation fails String key; String subProtocol = null; List extensions = Collections.emptyList(); @@ -111,24 +129,6 @@ public class WsFilter implements Filter return; } -// Need an Endpoint instance to progress this further -WsServerContainer sc = WsServerContainer.getServerContainer(); -String path; -String pathInfo = req.getPathInfo(); -if (pathInfo == null) { -path = req.getServletPath(); -} else { -path = req.getServletPath() + pathInfo; -} -WsMappingResult mappingResult = sc.findMapping(path); - -if (mappingResult == null) { -// No endpoint registered for the requested path. Let the -// application handle it (it might redirect or forward for example) -chain.doFilter(request, response); -return; -} - ServerEndpointConfig sec = mappingResult.getConfig(); // Origin check @@ -145,6 +145,7 @@ public class WsFilter implements Filter getNegotiatedSubprotocol( sec.getSubprotocols(), subProtocols); } + // Extensions // Currently no extensions are supported by this implementation @@ -199,7 +200,6 @@ public class WsFilter implements Filter req.upgrade(WsHttpUpgradeHandler.class); wsHandler.preInit(ep, sec, sc, wsRequest, subProtocol, mappingResult.getPathParams(), req.isSecure()); - } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54926] WsFilter performs handshake validation even if it doesn't have a mapped endpoint
https://issues.apache.org/bugzilla/show_bug.cgi?id=54926 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #2 from Mark Thomas --- RFC 6455 puts checking for a matching URI earlier in the list of checks too. The change has been applied to trunk. -- 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
[Bug 54921] Redeploy problem with Preferences= Illegal access: this web application instance has been stopped already. Could not load com.sun.org.apache.xalan.internal.xsltc.dom.XSLTCDTMManager.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54921 Mark Thomas changed: What|Removed |Added Status|NEW |NEEDINFO --- Comment #1 from Mark Thomas --- It isn't clear which preferences API you are using. The code appears to be using "java.util.prefs" which is from Java 1.4 yet you state you are using a "new" preferences API. Something doesn't add up here. What you seeing is a form of memory leak [1]. It isn't possible to tell if this is an application issue, a JRE issue or a Tomcat issue. If it is a Tomcat issue we should be able to fix it. If it is a JRE issue we might be able to work around it. If it is an application issue there is nothing we can do. To progress this we need the simplest possible test case that reproduces this. >From your description you should be able to do this with a single JSP or Servlet. If you provide a Servlet, please just provide the source code for the Servlet (it should not have any 3rd party dependencies). Finally, this issue may be platform dependent so please can you provide information on exactly what platform (OS, JVM) you are seeing this issue on. [1] http://people.apache.org/~markt/presentations/2010-11-04-Memory-Leaks-60mins.pdf -- 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
buildbot success in ASF Buildbot on tomcat-trunk
The Buildbot has detected a restored build on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4279 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1479061 Blamelist: markt Build succeeded! sincerely, -The Buildbot
[Bug 54928] New: IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING]
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928 Bug ID: 54928 Summary: IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING] Product: Tomcat 8 Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P2 Component: Catalina Assignee: dev@tomcat.apache.org Reporter: rstoyanc...@yahoo.com Classification: Unclassified In an async scenario (request.startAsync), when the client goes away, trying to write to the response raises an IOException. If I then call asyncContext.complete() in order to finalize and clean up the request, soon after the following exception occurs: java.lang.IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING] at org.apache.coyote.AsyncStateMachine.asyncError(AsyncStateMachine.java:304) at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:793) at org.apache.coyote.Request.action(Request.java:373) at org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:441) at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:312) at org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1509) at org.apache.coyote.http11.Http11NioProcessor.asyncDispatch(Http11NioProcessor.java:221) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:619) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1581) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1540) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) It looks like an attempt to maybe to send an error event to AsyncListener's but asyncContext.complete has already been called. Is calling asyncContext.complete() a reasonable way to handle an IOException from the response in order to finalize the request and release any resorces associated with it? -- 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
[Bug 54928] IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING]
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Mark Thomas --- This is a question for the users list if you want to discuss this further (and possibly the Servlet EG as I don't see a clear definition of how an app is expected to handle this in the spec). I'm assuming that the I/O operation that triggers the error does not occur on a container thread. If it occurs in a container thread let Tomcat handle it. Looking at the Tomcat source code, a dispatch to a simple error page should trigger an error when it tries to write to the response which in turn should trigger the onError method of any registered AsyncListener allowing you to do the clean-up. -- 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
[Bug 54928] IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING]
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928 rstoyanc...@yahoo.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID |--- --- Comment #2 from rstoyanc...@yahoo.com --- Okay, I see. It looks like one has to dispatch before calling asyncContext.complete(). I opened this ticket because of the exception but I didn't realize it was illegal ot call complete() from a non-container thread. Maybe that can be detected and rejected with a message to that extent. -- 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
[Bug 54928] IllegalStateException: Calling [asyncError()] is not valid for a request with Async state [COMPLETING]
https://issues.apache.org/bugzilla/show_bug.cgi?id=54928 Mark Thomas changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |INVALID --- Comment #3 from Mark Thomas --- (In reply to comment #2) > Okay, I see. It looks like one has to dispatch before calling > asyncContext.complete(). In this case you need the dispatch to get the request back onto a container thread where the error handling can deal with the error. It is this bit I am not 100% is what is intended by the spec but I can't find any clear definitions. > I opened this ticket because of the exception but I > didn't realize it was illegal ot call complete() from a non-container > thread. Maybe that can be detected and rejected with a message to that > extent. It is perfectly valid to call complete() from a non-container thread. Again, the users list is the place to discuss this. -- 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
[Bug 54746] Cannot obtain idempotent information from Session in onError method after session closed
https://issues.apache.org/bugzilla/show_bug.cgi?id=54746 Mark Thomas changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |WONTFIX --- Comment #4 from Mark Thomas --- The final WebSocket spec is very clear on the required behaviour and this is what Tomcat implements. I've looked through the code and the only time I can find where Endpoint.onError() is called after the session has been closed is if for the following sequence of events: - Server receives close message - server fires session.onClose() - session is marked as closed - server echos close message back to the client - the sending of that message fails This is easily detected via the onOpen() method of the session and isn't - given that as far as the app is concerned it was a normal shutdown - something I am too concerned about. It could be argued that it would be reasonable in this case to just swallow the error. It would be useful to get some clarity on this from the EG but I don't see it as a bug issue. I also took a look at how things like network errors are handled. In that case onClose() is triggered with a suitable close code. If you have a test case (other than the one above) that demonstrates onClose() being called before onError() I'd be happy to take look. Just re-open this and provide some steps to reproduce. -- 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: r1479175 - in /tomcat/trunk/java/org/apache/catalina/loader: LocalStrings.properties WebappClassLoader.java
Author: markt Date: Sat May 4 20:59:07 2013 New Revision: 1479175 URL: http://svn.apache.org/r1479175 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54906 Better error message for ConcurrentModificationException when checking for memory leaks and continue with remaining checks. Based on a patch by NateC. Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Modified: tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1479175&r1=1479174&r2=1479175&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/loader/LocalStrings.properties Sat May 4 20:59:07 2013 @@ -30,6 +30,7 @@ webappClassLoader.checkThreadLocalsForLe webappClassLoader.checkThreadLocalsForLeaksDebug=The web application [{0}] created a ThreadLocal with key of type [{1}] (value [{2}]). The ThreadLocal has been correctly set to null and the key will be removed by GC. webappClassLoader.checkThreadLocalsForLeaksFail=Failed to check for ThreadLocal references for web application [{0}] webappClassLoader.checkThreadsHttpClient=Found HttpClient keep-alive thread using web application class loader. Fixed by switching thread to the parent class loader. +webappClassLoader.loadedByThisOrChildFail=Failed to fully check the entries in an instance of [{0}] for potential memory leaks in context [{1}] webappClassLoader.stopThreadFail=Failed to terminate thread named [{0}] for web application [{1}] webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread named [{0}] for web application [{1}] webappClassLoader.validationErrorJarPath=Unable to validate JAR entry with name {0} 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=1479175&r1=1479174&r2=1479175&view=diff == --- tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Sat May 4 20:59:07 2013 @@ -41,6 +41,7 @@ import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Collection; +import java.util.ConcurrentModificationException; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -2312,11 +2313,17 @@ public class WebappClassLoader if (o instanceof Collection) { Iterator iter = ((Collection) o).iterator(); -while (iter.hasNext()) { -Object entry = iter.next(); -if (loadedByThisOrChild(entry)) { -return true; +try { +while (iter.hasNext()) { +Object entry = iter.next(); +if (loadedByThisOrChild(entry)) { +return true; +} } +} catch (ConcurrentModificationException e) { +log.warn(sm.getString( +"webappClassLoader", clazz.getName(), getContextName()), +e); } } return false; - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot exception in ASF Buildbot on tomcat-trunk
The Buildbot has detected a new failure on builder tomcat-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-trunk/builds/4280 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/trunk] 1479175 Blamelist: markt BUILD FAILED: exception svn upload_2 sincerely, -The Buildbot
svn commit: r1479177 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/loader/LocalStrings.properties java/org/apache/catalina/loader/WebappClassLoader.java webapps/docs/changelog.xml
Author: markt Date: Sat May 4 21:11:18 2013 New Revision: 1479177 URL: http://svn.apache.org/r1479177 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54906 Better error message for ConcurrentModificationException when checking for memory leaks and continue with remaining checks. Based on a patch by NateC. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/LocalStrings.properties tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1479175 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/LocalStrings.properties?rev=1479177&r1=1479176&r2=1479177&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/LocalStrings.properties (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/LocalStrings.properties Sat May 4 21:11:18 2013 @@ -51,6 +51,7 @@ webappClassLoader.checkThreadLocalsForLe webappClassLoader.checkThreadLocalsForLeaksDebug=The web application [{0}] created a ThreadLocal with key of type [{1}] (value [{2}]). The ThreadLocal has been correctly set to null and the key will be removed by GC. webappClassLoader.checkThreadLocalsForLeaksFail=Failed to check for ThreadLocal references for web application [{0}] webappClassLoader.checkThreadsHttpClient=Found HttpClient keep-alive thread using web application class loader. Fixed by switching thread to the parent class loader. +webappClassLoader.loadedByThisOrChildFail=Failed to fully check the entries in an instance of [{0}] for potential memory leaks in context [{1}] webappClassLoader.stopThreadFail=Failed to terminate thread named [{0}] for web application [{1}] webappClassLoader.stopTimerThreadFail=Failed to terminate TimerThread named [{0}] for web application [{1}] webappClassLoader.validationErrorJarPath=Unable to validate JAR entry with name {0} Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java?rev=1479177&r1=1479176&r2=1479177&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/loader/WebappClassLoader.java Sat May 4 21:11:18 2013 @@ -43,6 +43,7 @@ import java.security.PrivilegedAction; import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Collection; +import java.util.ConcurrentModificationException; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -2579,11 +2580,17 @@ public class WebappClassLoader if (o instanceof Collection) { Iterator iter = ((Collection) o).iterator(); -while (iter.hasNext()) { -Object entry = iter.next(); -if (loadedByThisOrChild(entry)) { -return true; +try { +while (iter.hasNext()) { +Object entry = iter.next(); +if (loadedByThisOrChild(entry)) { +return true; +} } +} catch (ConcurrentModificationException e) { +log.warn(sm.getString( +"webappClassLoader", clazz.getName(), getContextName()), +e); } } return false; Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479177&r1=1479176&r2=1479177&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:11:18 2013 @@ -83,6 +83,13 @@ to) that an error has occurred and that the connection is being closed. (markt) + +54906: Better error message if a +ConcurrentModificationException occurs while checking for +memory leaks when a web application stops. Also ensure that the +exception does not cause remaining checks to be skipped. Based on a +patch by NateC. + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
buildbot exception in ASF Buildbot on tomcat-7-trunk
The Buildbot has detected a new failure on builder tomcat-7-trunk while building ASF Buildbot. Full details are available at: http://ci.apache.org/builders/tomcat-7-trunk/builds/1191 Buildbot URL: http://ci.apache.org/ Buildslave for this Build: bb-vm_ubuntu Build Reason: scheduler Build Source Stamp: [branch tomcat/tc7.0.x/trunk] 1479177 Blamelist: markt BUILD FAILED: exception svn upload_2 sincerely, -The Buildbot
svn commit: r1479179 - in /tomcat/trunk: java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/examples/WEB-INF/web.xml
Author: markt Date: Sat May 4 21:20:27 2013 New Revision: 1479179 URL: http://svn.apache.org/r1479179 Log: 204 responses are permitted entity headers Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/webapps/examples/WEB-INF/web.xml Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479179&r1=1479178&r2=1479179&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat May 4 21:20:27 2013 @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.Atomi import java.util.regex.Pattern; import javax.servlet.RequestDispatcher; +import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpUpgradeHandler; import org.apache.coyote.AbstractProcessor; @@ -1362,7 +1363,8 @@ public abstract class AbstractHttp11Proc } MimeHeaders headers = response.getMimeHeaders(); -if (!entityBody) { +// A SC_NO_CONTENT response may include entity headers +if (!entityBody && statusCode != HttpServletResponse.SC_NO_CONTENT) { response.setContentLength(-1); } else { String contentType = response.getContentType(); Modified: tomcat/trunk/webapps/examples/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/web.xml?rev=1479179&r1=1479178&r2=1479179&view=diff == --- tomcat/trunk/webapps/examples/WEB-INF/web.xml (original) +++ tomcat/trunk/webapps/examples/WEB-INF/web.xml Sat May 4 21:20:27 2013 @@ -27,6 +27,20 @@ Servlet and JSP Examples + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1479179 - in /tomcat/trunk: java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/examples/WEB-INF/web.xml
On May 4, 2013, at 4:20 PM, ma...@apache.org wrote: > Author: markt > Date: Sat May 4 21:20:27 2013 > New Revision: 1479179 > > URL: http://svn.apache.org/r1479179 > Log: > 204 responses are permitted entity headers > > Modified: >tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java >tomcat/trunk/webapps/examples/WEB-INF/web.xml > > Modified: > tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > URL: > http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479179&r1=1479178&r2=1479179&view=diff > == > --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > (original) > +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > Sat May 4 21:20:27 2013 > @@ -24,6 +24,7 @@ import java.util.concurrent.atomic.Atomi > import java.util.regex.Pattern; > > import javax.servlet.RequestDispatcher; > +import javax.servlet.http.HttpServletResponse; > import javax.servlet.http.HttpUpgradeHandler; > > import org.apache.coyote.AbstractProcessor; > @@ -1362,7 +1363,8 @@ public abstract class AbstractHttp11Proc > } > > MimeHeaders headers = response.getMimeHeaders(); > -if (!entityBody) { > +// A SC_NO_CONTENT response may include entity headers > +if (!entityBody && statusCode != HttpServletResponse.SC_NO_CONTENT) { > response.setContentLength(-1); > } else { > String contentType = response.getContentType(); > > Modified: tomcat/trunk/webapps/examples/WEB-INF/web.xml > URL: > http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/web.xml?rev=1479179&r1=1479178&r2=1479179&view=diff > == > --- tomcat/trunk/webapps/examples/WEB-INF/web.xml (original) > +++ tomcat/trunk/webapps/examples/WEB-INF/web.xml Sat May 4 21:20:27 2013 > @@ -27,6 +27,20 @@ > > Servlet and JSP Examples > > + > + > > > > Seems to me like maybe a bug should be created making the points outlined in the mailing list discussion so that there's a point of reference for why this change was made. I assume, also, that this will get ported to Tomcat 7 branch and suggested for Tomcat 6? Nick smime.p7s Description: S/MIME cryptographic signature
svn commit: r1479189 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/docs/changelog.xml
Author: markt Date: Sat May 4 21:49:16 2013 New Revision: 1479189 URL: http://svn.apache.org/r1479189 Log: 204 responses are permitted entity headers Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1479179 Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479189&r1=1479188&r2=1479189&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Sat May 4 21:49:16 2013 @@ -1378,7 +1378,8 @@ public abstract class AbstractHttp11Proc } MimeHeaders headers = response.getMimeHeaders(); -if (!entityBody) { +// A SC_NO_CONTENT (204) response may include entity headers +if (!entityBody && statusCode != 204) { response.setContentLength(-1); } else { String contentType = response.getContentType(); Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479189&r1=1479188&r2=1479189&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:49:16 2013 @@ -90,6 +90,10 @@ exception does not cause remaining checks to be skipped. Based on a patch by NateC. + +Allow 204 responses (no content) to include entity headers as required +by RFC2616. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1479190 - /tomcat/trunk/webapps/examples/WEB-INF/web.xml
Author: markt Date: Sat May 4 21:50:06 2013 New Revision: 1479190 URL: http://svn.apache.org/r1479190 Log: Remove accidental commit. No convinced this helps yet. Modified: tomcat/trunk/webapps/examples/WEB-INF/web.xml Modified: tomcat/trunk/webapps/examples/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/web.xml?rev=1479190&r1=1479189&r2=1479190&view=diff == --- tomcat/trunk/webapps/examples/WEB-INF/web.xml (original) +++ tomcat/trunk/webapps/examples/WEB-INF/web.xml Sat May 4 21:50:06 2013 @@ -27,21 +27,6 @@ Servlet and JSP Examples - - - Timing filter - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 54906] WebappClassLoader.loadedByThisOrChild can throw ConcurrentModificationException
https://issues.apache.org/bugzilla/show_bug.cgi?id=54906 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Mark Thomas --- loadedByThisOrChild() is called by more than just the thread load code so I used your patch but with a dedicated error message rather than re-using an existing one. The fix has been applied to trunk and 7.0.x and will be included in 7.0.40 onwards. -- 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: r1479195 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
Author: markt Date: Sat May 4 22:03:36 2013 New Revision: 1479195 URL: http://svn.apache.org/r1479195 Log: Remove accidental commit. Modified: tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml Modified: tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml?rev=1479195&r1=1479194&r2=1479195&view=diff == --- tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml Sat May 4 22:03:36 2013 @@ -27,6 +27,20 @@ Servlet and JSP Examples + + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1479196 - /tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml
Author: markt Date: Sat May 4 22:05:49 2013 New Revision: 1479196 URL: http://svn.apache.org/r1479196 Log: Doh. Modified: tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml Modified: tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml?rev=1479196&r1=1479195&r2=1479196&view=diff == --- tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/examples/WEB-INF/web.xml Sat May 4 22:05:49 2013 @@ -27,21 +27,6 @@ Servlet and JSP Examples - - - Timing filter - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1479197 - /tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java
Author: markt Date: Sat May 4 22:08:52 2013 New Revision: 1479197 URL: http://svn.apache.org/r1479197 Log: Silence some Eclipse warnings about unused code Modified: tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Modified: tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java?rev=1479197&r1=1479196&r2=1479197&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Sat May 4 22:08:52 2013 @@ -27,12 +27,12 @@ package org.apache.tomcat.util; import java.lang.management.ClassLoadingMXBean; import java.lang.management.CompilationMXBean; -import java.lang.management.GarbageCollectorMXBean; +//import java.lang.management.GarbageCollectorMXBean; import java.lang.management.LockInfo; import java.lang.management.ManagementFactory; -import java.lang.management.MemoryMXBean; -import java.lang.management.MemoryManagerMXBean; -import java.lang.management.MemoryPoolMXBean; +//import java.lang.management.MemoryMXBean; +//import java.lang.management.MemoryManagerMXBean; +//import java.lang.management.MemoryPoolMXBean; import java.lang.management.MonitorInfo; import java.lang.management.OperatingSystemMXBean; import java.lang.management.RuntimeMXBean; @@ -40,7 +40,7 @@ import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; import java.text.SimpleDateFormat; import java.util.Date; -import java.util.List; +//import java.util.List; import java.util.Map; import java.util.logging.LogManager; import java.util.logging.LoggingMXBean; @@ -76,6 +76,8 @@ public class Diagnostics { // dynamically in the MBeanServer. private static final LoggingMXBean loggingMXBean = LogManager.getLoggingMXBean(); +// TODO - Use these +/* private static final MemoryMXBean memoryMXBeans = ManagementFactory.getMemoryMXBean(); private static final List garbageCollectorMXBean = @@ -84,6 +86,7 @@ public class Diagnostics { ManagementFactory.getMemoryManagerMXBeans(); private static final List memoryPoolMXBeans = ManagementFactory.getMemoryPoolMXBeans(); +*/ /** * Check whether thread contention monitoring is enabled. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1479205 - in /tomcat/trunk/java/org/apache/catalina/manager: LocalStrings.properties ManagerServlet.java
Author: markt Date: Sat May 4 22:23:22 2013 New Revision: 1479205 URL: http://svn.apache.org/r1479205 Log: i18n Modified: tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Modified: tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties?rev=1479205&r1=1479204&r2=1479205&view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/manager/LocalStrings.properties Sat May 4 22:23:22 2013 @@ -105,6 +105,7 @@ managerServlet.sessiontimeout={0} minute managerServlet.sessiontimeout.unlimited=unlimited time: {0} sessions managerServlet.sessiontimeout.expired={0} minutes: {1} sessions were expired managerServlet.sessions=OK - Session information for application at context path {0} +managerServlet.sslConnectorCiphers=OK - Connector / SSL Cipher information managerServlet.started=OK - Started application at context path {0} managerServlet.startFailed=FAIL - Application at context path {0} could not be started managerServlet.stopped=OK - Stopped application at context path {0} Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1479205&r1=1479204&r2=1479205&view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Sat May 4 22:23:22 2013 @@ -372,7 +372,7 @@ public class ManagerServlet extends Http } else if (command.equals("/threaddump")) { threadDump(writer, smClient); } else if (command.equals("/sslConnectorCiphers")) { -sslConnectorCiphers(writer); +sslConnectorCiphers(writer, smClient); } else { writer.println(smClient.getString("managerServlet.unknownCommand", command)); @@ -557,8 +557,10 @@ public class ManagerServlet extends Http writer.print(Diagnostics.getThreadDump()); } -protected void sslConnectorCiphers(PrintWriter writer) { -writer.println("OK - Connector / SSL Cipher information"); +protected void sslConnectorCiphers(PrintWriter writer, +StringManager smClient) { +writer.println(smClient.getString( +"managerServlet.sslConnectorCiphers")); Map> connectorCiphers = getConnectorCiphers(); for (Map.Entry> entry : connectorCiphers.entrySet()) { writer.println(entry.getKey()); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1479212 - in /tomcat/trunk/java/org/apache: catalina/manager/ManagerServlet.java tomcat/util/Diagnostics.java tomcat/util/LocalStrings.properties
Author: markt Date: Sat May 4 22:45:19 2013 New Revision: 1479212 URL: http://svn.apache.org/r1479212 Log: i18n for diagnostics using the user's Locale Added: tomcat/trunk/java/org/apache/tomcat/util/LocalStrings.properties (with props) Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Modified: tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java?rev=1479212&r1=1479211&r2=1479212&view=diff == --- tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java (original) +++ tomcat/trunk/java/org/apache/catalina/manager/ManagerServlet.java Sat May 4 22:45:19 2013 @@ -368,9 +368,9 @@ public class ManagerServlet extends Http } else if (command.equals("/findleaks")) { findleaks(statusLine, writer, smClient); } else if (command.equals("/vminfo")) { -vmInfo(writer, smClient); +vmInfo(writer, request.getLocales()); } else if (command.equals("/threaddump")) { -threadDump(writer, smClient); +threadDump(writer, request.getLocales()); } else if (command.equals("/sslConnectorCiphers")) { sslConnectorCiphers(writer, smClient); } else { @@ -543,8 +543,9 @@ public class ManagerServlet extends Http * * @param writer */ -protected void vmInfo(PrintWriter writer, StringManager smClient) { -writer.print(Diagnostics.getVMInfo()); +protected void vmInfo(PrintWriter writer, +Enumeration requestedLocales) { +writer.print(Diagnostics.getVMInfo(requestedLocales)); } /** @@ -553,8 +554,9 @@ public class ManagerServlet extends Http * * @param writer */ -protected void threadDump(PrintWriter writer, StringManager smClient) { -writer.print(Diagnostics.getThreadDump()); +protected void threadDump(PrintWriter writer, +Enumeration requestedLocales) { +writer.print(Diagnostics.getThreadDump(requestedLocales)); } protected void sslConnectorCiphers(PrintWriter writer, Modified: tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java?rev=1479212&r1=1479211&r2=1479212&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/Diagnostics.java Sat May 4 22:45:19 2013 @@ -16,7 +16,6 @@ */ // XXX TODO: Source code line length -// XXX TODO: StringManager // XXX TODO: Sort logger names and system property keys in getVMInfo() // XXX TODO: Add memory and GC MBeans to getVMInfo() // XXX Optional: Wire setters to the manager: @@ -40,13 +39,20 @@ import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.Enumeration; +import java.util.Locale; //import java.util.List; import java.util.Map; import java.util.logging.LogManager; import java.util.logging.LoggingMXBean; +import org.apache.tomcat.util.res.StringManager; + public class Diagnostics { +private static final String PACKAGE = "org.apache.tomcat.util"; +private static final StringManager sm = StringManager.getManager(PACKAGE); + private static final String INDENT1 = " "; private static final String INDENT2 = "\t"; private static final String INDENT3 = " "; @@ -288,11 +294,32 @@ public class Diagnostics { return ""; } +private static StringManager getStringManager( +Enumeration requestedLocales) { +while (requestedLocales.hasMoreElements()) { +Locale locale = requestedLocales.nextElement(); +StringManager result = StringManager.getManager(PACKAGE, locale); +if (result.getLocale().equals(locale)) { +return result; +} +} +// Return the default +return sm; +} + +public static String getThreadDump() { +return getThreadDump(sm); +} + +public static String getThreadDump(Enumeration requestedLocales) { +return getThreadDump(getStringManager(requestedLocales)); +} + /** * Retrieve a formatted JVM thread dump. * @return the thread dump */ -public static String getThreadDump() { +public static String getThreadDump(StringManager requestedSm) { StringBuilder sb = new StringBuilder(); synchronized(timeformat) { @@ -300,7 +327,8 @@ public class Diagnostics { } sb.append(CRLF); -sb.append("Full thread dump "); +sb.append(requestedSm.getString("dia
Re: svn commit: r1479189 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/coyote/http11/AbstractHttp11Processor.java webapps/docs/changelog.xml
2013/5/5 : > Author: markt > Date: Sat May 4 21:49:16 2013 > New Revision: 1479189 > > URL: http://svn.apache.org/r1479189 > Log: > 204 responses are permitted entity headers > > Modified: > tomcat/tc7.0.x/trunk/ (props changed) > > tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml > > Propchange: tomcat/tc7.0.x/trunk/ > -- > Merged /tomcat/trunk:r1479179 > > Modified: > tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > URL: > http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java?rev=1479189&r1=1479188&r2=1479189&view=diff > == > --- > tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > (original) > +++ > tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java > Sat May 4 21:49:16 2013 > @@ -1378,7 +1378,8 @@ public abstract class AbstractHttp11Proc > } > > MimeHeaders headers = response.getMimeHeaders(); > -if (!entityBody) { > +// A SC_NO_CONTENT (204) response may include entity headers > +if (!entityBody && statusCode != 204) { > response.setContentLength(-1); > } else { > String contentType = response.getContentType(); > The talk in "Status 204" thread on users@ [1] was about Content-Type header, but this change affects Content-Length one as well. Why are you skipping "setContentLength(-1)" call? [1] http://tomcat.markmail.org/thread/pah7hg7xv2wqvqs3 > Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml > URL: > http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1479189&r1=1479188&r2=1479189&view=diff > == > --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) > +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sat May 4 21:49:16 2013 > @@ -90,6 +90,10 @@ > exception does not cause remaining checks to be skipped. Based on a > patch by NateC. > > + > +Allow 204 responses (no content) to include entity headers as > required > +by RFC2616. (markt) > + > > Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org