[Bug 54387] Having servlets with same url should at least cause warning
https://issues.apache.org/bugzilla/show_bug.cgi?id=54387 Loïc Albertin changed: What|Removed |Added CC||loic.alber...@ow2.org --- Comment #7 from Loïc Albertin --- Hi Violeta, thank you for that clarification, I agree with you. I missed this statement in the specification. Thanks again. Regards, Loïc -- 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: r1489351 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: kkolinko Date: Tue Jun 4 09:11:13 2013 New Revision: 1489351 URL: http://svn.apache.org/r1489351 Log: Propose a patch 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=1489351&r1=1489350&r2=1489351&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Jun 4 09:11:13 2013 @@ -40,17 +40,17 @@ PATCHES PROPOSED TO BACKPORT: http://svn.apache.org/r1484924 (documentation) Already committed in Tomcat 6. Formally proposing for a review, see Re:r1484923 thread on dev@. - Two followup patches are below. + A followup patch is below. +1: markt, kkolinko -1: Followups to r1484923: - http://svn.apache.org/r1485114 - http://svn.apache.org/r1488151 - (markt/kkolinko) - +1: + Make antiLockingDocBase an absolute path and simplify code. + Patch: + http://people.apache.org/~kkolinko/patches/2013-06-04_tc6_antiLockingDocBase.patch + (Backport of r1485114 + r1488151, markt/kkolinko) + +1: kkolinko -1: - kkolinko: r1485114 does not merge cleanly. A patch file is needed. * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55019 Fix an exception that occurs when accessing certain JSP page when running - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489385 [3/3] - in /tomcat/trunk: java/org/apache/catalina/filters/ test/org/apache/catalina/filters/ webapps/docs/config/
Modified: tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java?rev=1489385&r1=1489384&r2=1489385&view=diff == --- tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java (original) +++ tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java Tue Jun 4 10:51:31 2013 @@ -19,7 +19,10 @@ package org.apache.catalina.filters; import java.io.IOException; import java.io.OutputStream; import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; import java.util.Collection; +import java.util.List; import java.util.Locale; import javax.servlet.ServletOutputStream; @@ -36,10 +39,66 @@ import org.apache.catalina.connector.Req */ public class TesterHttpServletResponse implements HttpServletResponse { +private PrintWriter pw; +private List headerNames = new ArrayList<>(); +private List headerValues = new ArrayList<>(); +private int status; + public TesterHttpServletResponse() { // NOOP } + +@Override +public PrintWriter getWriter() throws IOException { +if (pw == null) { +pw = new PrintWriter(new StringWriter()); +} +return pw; +} + + +@Override +public String getHeader(String name) { +int index = headerNames.indexOf(name); +if (index != -1) { +return headerValues.get(index); +} +return null; +} + + +@Override +public void setHeader(String name, String value) { +int index = headerNames.indexOf(name); +if (index != -1) { +headerValues.set(index, value); +} else { +headerNames.add(name); +headerValues.add(value); +} +} + + +@Override +public void addHeader(String name, String value) { +headerNames.add(name); +headerValues.add(value); +} + + +@Override +public int getStatus() { +return status; +} + + +@Override +public void setStatus(int status) { +this.status = status; +} + + public void setAppCommitted( @SuppressWarnings("unused") boolean appCommitted) {/* NOOP */} public boolean isAppCommitted() { return false; } @@ -124,8 +183,6 @@ public class TesterHttpServletResponse i @Override public Locale getLocale() { return null; } @Override -public PrintWriter getWriter() throws IOException { return null; } -@Override public boolean isCommitted() { return false; } @Override public void reset() {/* NOOP */} @@ -140,14 +197,10 @@ public class TesterHttpServletResponse i @Override public void setLocale(Locale locale) {/* NOOP */} @Override -public String getHeader(String name) { return null; } -@Override public Collection getHeaderNames() { return null; } @Override public Collection getHeaders(String name) { return null; } public String getMessage() { return null; } -@Override -public int getStatus() { return -1; } public void reset(@SuppressWarnings("unused") int status, @SuppressWarnings("unused") String message) {/* NOOP */} @Override @@ -155,8 +208,6 @@ public class TesterHttpServletResponse i @Override public void addDateHeader(String name, long value) {/* NOOP */} @Override -public void addHeader(String name, String value) {/* NOOP */} -@Override public void addIntHeader(String name, int value) {/* NOOP */} @Override public boolean containsHeader(String name) { return false; } @@ -188,11 +239,7 @@ public class TesterHttpServletResponse i @Override public void setDateHeader(String name, long value) {/* NOOP */} @Override -public void setHeader(String name, String value) {/* NOOP */} -@Override public void setIntHeader(String name, int value) {/* NOOP */} -@Override -public void setStatus(int status) {/* NOOP */} /** @deprecated */ @Override @Deprecated Added: tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java?rev=1489385&view=auto == --- tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java (added) +++ tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java Tue Jun 4 10:51:31 2013 @@ -0,0 +1,320 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 +
svn commit: r1489385 [1/3] - in /tomcat/trunk: java/org/apache/catalina/filters/ test/org/apache/catalina/filters/ webapps/docs/config/
Author: markt Date: Tue Jun 4 10:51:31 2013 New Revision: 1489385 URL: http://svn.apache.org/r1489385 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55046 Add a Filter that implements CORS (http://www.w3.org/TR/cors/) Based on a patch by Mohit Soni. Added: tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java (with props) tomcat/trunk/test/org/apache/catalina/filters/TestCorsFilter.java (with props) tomcat/trunk/test/org/apache/catalina/filters/TesterFilterChain.java (with props) tomcat/trunk/test/org/apache/catalina/filters/TesterFilterConfigs.java (with props) tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java (with props) tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java (with props) Modified: tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java tomcat/trunk/webapps/docs/config/filter.xml Added: tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java?rev=1489385&view=auto == --- tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java (added) +++ tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java Tue Jun 4 10:51:31 2013 @@ -0,0 +1,1162 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.catalina.filters; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.juli.logging.Log; +import org.apache.juli.logging.LogFactory; +import org.apache.tomcat.util.res.StringManager; + +/** + * + * A {@link Filter} that enable client-side cross-origin requests by + * implementing W3C's CORS (Cross-Origin Resource + * Sharing) specification for resources. Each {@link HttpServletRequest} + * request is inspected as per specification, and appropriate response headers + * are added to {@link HttpServletResponse}. + * + * + * + * By default, it also sets following request attributes, that help to + * determine the nature of the request downstream. + * + * cors.isCorsRequest: Flag to determine if the request is a CORS + * request. Set to true if a CORS request; false + * otherwise. + * cors.request.origin: The Origin URL, i.e. the URL of the page from + * where the request is originated. + * + * cors.request.type: Type of request. Possible values: + * + * SIMPLE: A request which is not preceded by a pre-flight request. + * ACTUAL: A request which is preceded by a pre-flight request. + * PRE_FLIGHT: A pre-flight request. + * NOT_CORS: A normal same-origin request. + * INVALID_CORS: A cross-origin request which is invalid. + * + * + * cors.request.headers: Request headers sent as + * 'Access-Control-Request-Headers' header, for pre-flight request. + * + * + * + * @see http://www.w3.org/TR/cors/";>CORS specification + * + */ +public final class CorsFilter implements Filter { + +private static final Log log = LogFactory.getLog(CorsFilter.class); + +private static final StringManager sm = +StringManager.getManager(Constants.Package); + + +/** + * A {@link Collection} of origins consisting of zero or more origins that + * are allowed access to the resource. + */ +private final Collection allowedOrigins; + +/** + * Determines if any origin is allowed to make request. + */ +private boolean anyOriginAllowed; + +/** + * A {@link Collection} of methods consisting of zero or more methods that + * are supported by the resource. + */ +private final C
[Tomcat Wiki] Update of "FAQ/Developing" by BrianBurch
Dear Wiki user, You have subscribed to a wiki page or wiki category on "Tomcat Wiki" for change notification. The "FAQ/Developing" page has been changed by BrianBurch: https://wiki.apache.org/tomcat/FAQ/Developing?action=diff&rev1=17&rev2=18 <> How do I remotely debug Tomcat using NetBeans? - This answer assumes that you have correctly set up a [[http://netbeans.org/|NetBeans]] project and that you know how to use the !NetBeans debugger. If not, please go to http://www.netbeans.org/kb/using-netbeans/40/debug.html and read up on how to use !NetBeans and its debugger. + This answer assumes that you know how to work with a !NetBeans Project, and also how to use the !NetBeans debugger. If not, please go to http://www.netbeans.org/kb/using-netbeans/40/debug.html and read up on how to use !NetBeans and its debugger. + + Starting with Tomcat trunk revision 1484409, the Tomcat source includes Ant tasks to configure your source directory as a !NetBeans Free-Form Project. After you have successfully run Ant with the default build target (''deploy''), you can then run the ''ide-netbeans'' target. This task will configure your sandbox copy of Tomcat so the source can be inspected, maintained and debugged under the !NetBeans IDE. You should follow the detailed instructions in the README.txt file that will have been installed in your new nbproject directory. Make sure that Tomcat is started in debug mode as described above, that your application is deployed, and that the sources are all defined as resources in your application. If you have a servlet or JSP file, set a breakpoint where you think a problem might be occurring. Go to "Run->Attach Debugger". A dialog pops up to let you specify the following options: @@ -111, +113 @@ Note that !NetBeans has a second option -- you can debug JSP files and servlets locally using a Tomcat server that is bundled with the IDE. When you debug a JSP file or servlet in the IDE, the bundled Tomcat server automatically starts in debug mode, and the debugger connects to it. - + The Tomcat !NetBeans targets have not yet been back-ported to Tomcat 7. You can copy the files from your copy of the trunk and they should only require minimal editing of paths to work with older versions of Tomcat. + === Other === <> - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55046] CORS Filter
https://issues.apache.org/bugzilla/show_bug.cgi?id=55046 --- Comment #5 from Mark Thomas --- Thanks for the updated patch but as I has already started work on the previous patch I have continued with that. The feedback was intended for future patches rather than a list of changes required for this patch. Additional notes from this morning's work: - Use of ServletContext.log() has been removed - Visibility, particularly of methods, has been reduced - line length in docs - s/Ex/Eg/ The patch has been applied to trunk. I'll wait on back-porting it to 7.0.x to give you a chance to review the applied patch. I'd like to include this in 7.0.41 which will be tagged in the next day or so the sooner you can review the applied patch the better. -- 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 55035] Deploy ROOT webapp with version through text manager using Ant
https://issues.apache.org/bugzilla/show_bug.cgi?id=55035 --- Comment #3 from Sergey Tcherednichenko --- thanks for including it to trunk :) and sorry for the problem with patch :) though, this is a fix for ant task property "version", but the issue with using "/##someversion" path is not fixed by this patch. Should I create another issue, or maybe just call such usage as deprecated? -- 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 55035] Deploy ROOT webapp with version through text manager using Ant
https://issues.apache.org/bugzilla/show_bug.cgi?id=55035 --- Comment #4 from Mark Thomas --- I'd say treat using ##version in a path as deprecated / unsupported. -- 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: r1489385 [1/3] - in /tomcat/trunk: java/org/apache/catalina/filters/ test/org/apache/catalina/filters/ webapps/docs/config/
2013/6/4 : > Author: markt > Date: Tue Jun 4 10:51:31 2013 > New Revision: 1489385 > > URL: http://svn.apache.org/r1489385 > Log: > Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55046 > Add a Filter that implements CORS (http://www.w3.org/TR/cors/) > Based on a patch by Mohit Soni. > > Added: > tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java (with > props) > tomcat/trunk/test/org/apache/catalina/filters/TestCorsFilter.java (with > props) > tomcat/trunk/test/org/apache/catalina/filters/TesterFilterChain.java > (with props) > tomcat/trunk/test/org/apache/catalina/filters/TesterFilterConfigs.java > (with props) > > tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletRequest.java > (with props) > tomcat/trunk/test/org/apache/catalina/filters/TesterServletContext.java > (with props) > Modified: > tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties > > tomcat/trunk/test/org/apache/catalina/filters/TesterHttpServletResponse.java > tomcat/trunk/webapps/docs/config/filter.xml > Two minor nits: in CorsFilter.java and LocalStrings.properties: > +if (preflightMaxAge != null) { > +try { > +if (!preflightMaxAge.isEmpty()) { > +this.preflightMaxAge = Long.parseLong(preflightMaxAge); > +} else { > +this.preflightMaxAge = 0L; > +} > +} catch (NumberFormatException e) { > +throw new ServletException( > +sm.getString("corsFilter.invalidPreFlightMaxAge"), > e); The message key casing is inconsistent with the name of the property. It would be "Preflight". in filter.xml: +is rejected with HTTP status code 403 (Forbidden). A +flowchart that +demonstrates request processing by this filter is available. I do not see "cors-flowchart.png" among added files. Best regards, Konstantin Kolinko - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: svn commit: r1489385 [1/3] - in /tomcat/trunk: java/org/apache/catalina/filters/ test/org/apache/catalina/filters/ webapps/docs/config/
On 04/06/2013 12:13, Konstantin Kolinko wrote: > The message key casing is inconsistent with the name of the property. > It would be "Preflight". Fixed. > in filter.xml: > > +is rejected with HTTP status code 403 (Forbidden). A > +flowchart that > +demonstrates request processing by this filter is available. > > I do not see "cors-flowchart.png" among added files. My bad. Fixed. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489390 - in /tomcat/trunk: java/org/apache/catalina/filters/CorsFilter.java java/org/apache/catalina/filters/LocalStrings.properties webapps/docs/images/cors-flowchart.png
Author: markt Date: Tue Jun 4 11:35:58 2013 New Revision: 1489390 URL: http://svn.apache.org/r1489390 Log: Review comments from kkolinko Added: tomcat/trunk/webapps/docs/images/cors-flowchart.png (with props) Modified: tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties Modified: tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java?rev=1489390&r1=1489389&r2=1489390&view=diff == --- tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java (original) +++ tomcat/trunk/java/org/apache/catalina/filters/CorsFilter.java Tue Jun 4 11:35:58 2013 @@ -759,7 +759,7 @@ public final class CorsFilter implements } } catch (NumberFormatException e) { throw new ServletException( -sm.getString("corsFilter.invalidPreFlightMaxAge"), e); +sm.getString("corsFilter.invalidPreflightMaxAge"), e); } } Modified: tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties?rev=1489390&r1=1489389&r2=1489390&view=diff == --- tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/filters/LocalStrings.properties Tue Jun 4 11:35:58 2013 @@ -14,7 +14,7 @@ # limitations under the License. addDefaultCharset.unsupportedCharset=Specified character set [{0}] is not supported -corsFilter.invalidPreFlightMaxAge=Unable to parse preflightMaxAge +corsFilter.invalidPreflightMaxAge=Unable to parse preflightMaxAge corsFilter.nullRequest=HttpServletRequest object is null corsFilter.nullRequestType=CORSRequestType object is null corsFilter.onlyHttp=CORS doesn't support non-HTTP request or response Added: tomcat/trunk/webapps/docs/images/cors-flowchart.png URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/images/cors-flowchart.png?rev=1489390&view=auto == Binary file - no diff available. Propchange: tomcat/trunk/webapps/docs/images/cors-flowchart.png -- svn:mime-type = image/png - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489405 - /tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java
Author: markt Date: Tue Jun 4 12:19:29 2013 New Revision: 1489405 URL: http://svn.apache.org/r1489405 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 Fall back to un-prefixed property if a prefixed one is not present Modified: tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.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=1489405&r1=1489404&r2=1489405&view=diff == --- tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original) +++ tomcat/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue Jun 4 12:19:29 2013 @@ -244,12 +244,31 @@ public class ClassLoaderLogManager exten */ @Override public String getProperty(String name) { -ClassLoader classLoader = Thread.currentThread() -.getContextClassLoader(); String prefix = this.prefix.get(); +String result = null; + +// If a prefix is defined look for a prefixed property first if (prefix != null) { -name = prefix + name; +result = findProperty(prefix + name); +} + +// If there is no prefix or no property match with the prefix try just +// the name +if (result == null) { +result = findProperty(name); +} + +// Simple property replacement (mostly for folder names) +if (result != null) { +result = replace(result); } +return result; +} + + +private String findProperty(String name) { +ClassLoader classLoader = Thread.currentThread() +.getContextClassLoader(); ClassLoaderLogInfo info = getClassLoaderInfo(classLoader); String result = info.props.getProperty(name); // If the property was not found, and the current classloader had no @@ -271,14 +290,9 @@ public class ClassLoaderLogManager exten result = super.getProperty(name); } } -// Simple property replacement (mostly for folder names) -if (result != null) { -result = replace(result); -} return result; } - @Override public void readConfiguration() throws IOException, SecurityException { - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489408 - /tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java
Author: markt Date: Tue Jun 4 12:24:41 2013 New Revision: 1489408 URL: http://svn.apache.org/r1489408 Log: Silence some Eclipse warnings Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java?rev=1489408&r1=1489407&r2=1489408&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java Tue Jun 4 12:24:41 2013 @@ -21,6 +21,7 @@ package org.apache.juli; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; +import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; @@ -372,7 +373,8 @@ public class FileHandler // Open the current log file writerLock.writeLock().lock(); -try { +FileOutputStream fos = null; +OutputStream os = null;try { File pathname = new File(dir.getAbsoluteFile(), prefix + (rotatable ? date : "") + suffix); File parent = pathname.getParentFile(); @@ -383,8 +385,8 @@ public class FileHandler return; } String encoding = getEncoding(); -FileOutputStream fos = new FileOutputStream(pathname, true); -OutputStream os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos; +fos = new FileOutputStream(pathname, true); +os = bufferSize>0?new BufferedOutputStream(fos,bufferSize):fos; writer = new PrintWriter( (encoding != null) ? new OutputStreamWriter(os, encoding) : new OutputStreamWriter(os), false); @@ -392,6 +394,20 @@ public class FileHandler } catch (Exception e) { reportError(null, e, ErrorManager.OPEN_FAILURE); writer = null; +if (fos != null) { +try { +fos.close(); +} catch (IOException e1) { +// Ignore +} +} +if (os != null) { +try { +os.close(); +} catch (IOException e1) { +// Ignore +} +} } finally { writerLock.writeLock().unlock(); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489411 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/juli/ClassLoaderLogManager.java webapps/docs/changelog.xml
Author: markt Date: Tue Jun 4 12:29:29 2013 New Revision: 1489411 URL: http://svn.apache.org/r1489411 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 Fall back to un-prefixed property if a prefixed one is not present Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1489405 Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java?rev=1489411&r1=1489410&r2=1489411&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/juli/ClassLoaderLogManager.java Tue Jun 4 12:29:29 2013 @@ -244,12 +244,31 @@ public class ClassLoaderLogManager exten */ @Override public String getProperty(String name) { -ClassLoader classLoader = Thread.currentThread() -.getContextClassLoader(); String prefix = this.prefix.get(); +String result = null; + +// If a prefix is defined look for a prefixed property first if (prefix != null) { -name = prefix + name; +result = findProperty(prefix + name); +} + +// If there is no prefix or no property match with the prefix try just +// the name +if (result == null) { +result = findProperty(name); +} + +// Simple property replacement (mostly for folder names) +if (result != null) { +result = replace(result); } +return result; +} + + +private String findProperty(String name) { +ClassLoader classLoader = Thread.currentThread() +.getContextClassLoader(); ClassLoaderLogInfo info = getClassLoaderInfo(classLoader); String result = info.props.getProperty(name); // If the property was not found, and the current classloader had no @@ -271,13 +290,9 @@ public class ClassLoaderLogManager exten result = super.getProperty(name); } } -// Simple property replacement (mostly for folder names) -if (result != null) { -result = replace(result); -} return result; } - + @Override public void readConfiguration() 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=1489411&r1=1489410&r2=1489411&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 4 12:29:29 2013 @@ -121,6 +121,11 @@ command of the Ant tasks for interfacing with the text based Manager application. Patch provided by Sergey Tcherednichenko. (markt) + +55052: JULI's LogManager now additionally looks for +logging properties without prefixes if the property cannot be found with +a prefix. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55052] [JULI] Make ClassLoaderLogManager.getProperty() to try unprefixed property if prefixed one does not exist
https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #1 from Mark Thomas --- Fixed in trunk and 7.0.x and will be included in 7.0.41 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
[Bug 55054] public method exitWhenFinished() removed from FileCleaningTracker.
https://issues.apache.org/bugzilla/show_bug.cgi?id=55054 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Mark Thomas --- (In reply to Mark Jeffcoat from comment #0) > The March 15 commit "Update to Commons IO 2.4 and run UCDetector over the > copied classes" removed FileCleaningTracker.exitWhenFinished(), presumably > by accident. It was deliberate, not accidental. > This makes it difficult to stop the reaper thread, which leads to memory > leaks. There is no reaper thread. (More code that can be removed. Removal of unused code is often an iterative process.) > I believe this is an error (by the UCDetector?): Commons IO 2.4 does have > this method, and the FileCleaningTracker Javadocs still refer to it. As above, this was deliberate. -- 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: r1489419 - in /tomcat/trunk/java/org/apache/tomcat/util/http/fileupload: FileCleaningTracker.java FileDeleteStrategy.java disk/DiskFileItem.java disk/DiskFileItemFactory.java
Author: markt Date: Tue Jun 4 12:48:18 2013 New Revision: 1489419 URL: http://svn.apache.org/r1489419 Log: Some more unused code clean-up. Removed: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileCleaningTracker.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/FileDeleteStrategy.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java?rev=1489419&r1=1489418&r2=1489419&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItem.java Tue Jun 4 12:48:18 2013 @@ -52,19 +52,7 @@ import org.apache.tomcat.util.http.fileu * it into memory, which may come handy with large files. * * Temporary files, which are created for file items, should be - * deleted later on. The best way to do this is using a - * {@link org.apache.tomcat.util.http.fileupload.FileCleaningTracker - * FileCleaningTracker}, which you can set on the - * {@link DiskFileItemFactory}. However, if you do use such a tracker, - * then you must consider the following: Temporary files are automatically - * deleted as soon as they are no longer needed. (More precisely, when the - * corresponding instance of {@link java.io.File} is garbage collected.) - * This is done by the so-called reaper thread, which is started - * automatically when the class - * {@link org.apache.tomcat.util.http.fileupload.FileCleaningTracker} is loaded. - * It might make sense to terminate that thread, for example, if - * your web application ends. See the section on "Resource cleanup" - * in the users guide of commons-fileupload. + * deleted later on. * * @since FileUpload 1.1 * Modified: tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java?rev=1489419&r1=1489418&r2=1489419&view=diff == --- tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/http/fileupload/disk/DiskFileItemFactory.java Tue Jun 4 12:48:18 2013 @@ -18,7 +18,6 @@ package org.apache.tomcat.util.http.file import java.io.File; -import org.apache.tomcat.util.http.fileupload.FileCleaningTracker; import org.apache.tomcat.util.http.fileupload.FileItem; import org.apache.tomcat.util.http.fileupload.FileItemFactory; @@ -53,18 +52,7 @@ import org.apache.tomcat.util.http.fileu * * * Temporary files, which are created for file items, should be - * deleted later on. The best way to do this is using a - * {@link FileCleaningTracker}, which you can set on the - * {@link DiskFileItemFactory}. However, if you do use such a tracker, - * then you must consider the following: Temporary files are automatically - * deleted as soon as they are no longer needed. (More precisely, when the - * corresponding instance of {@link java.io.File} is garbage collected.) - * This is done by the so-called reaper thread, which is started - * automatically when the class - * {@link org.apache.tomcat.util.http.fileupload.FileCleaningTracker} is loaded. - * It might make sense to terminate that thread, for example, if - * your web application ends. See the section on "Resource cleanup" - * in the users guide of commons-fileupload. + * deleted later on. * * @since FileUpload 1.1 * @@ -91,13 +79,6 @@ public class DiskFileItemFactory impleme */ private int sizeThreshold = DEFAULT_SIZE_THRESHOLD; -/** - * The instance of {@link FileCleaningTracker}, which is responsible - * for deleting temporary files. - * May be null, if tracking files is not required. - */ -private FileCleaningTracker fileCleaningTracker; - // --- Constructors /** @@ -194,36 +175,7 @@ public class DiskFileItemFactory impleme @Override public FileItem createItem(String fieldName, String contentType, boolean isFormField, String fileName) { -DiskFileItem result = new DiskFileItem(fieldName, contentType, +return new DiskFileItem(fieldName, contentType, isFormField, fileName, sizeThreshold, repository); -FileCleaningTracker tracker = getFileCleaningTracker(); -if (tracker != null) { -tracker.track(result.getTempFile(), result); -} -return result; -} - -
[Bug 54939] No useful logging when maxHeaderCount hit
https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 --- Comment #6 from Mark Thomas --- I'd like to see this issue resolved for the 7.0.41 so I will be fixing it shortly. -- 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: AsyncContext.dispatch(path) invoked more than once
2013/5/31 Violeta Georgieva wrote: > > 2013/5/29 Violeta Georgieva wrote: > > > > 2013/5/28 Konstantin Kolinko wrote: > > > > > > > > > I think that your patch is wrong. > > > > > > Looking at how ActionCode.ASYNC_DISPATCH is handled in different > > > connector implementations in Tomcat 7, the code is like the following: > > > > > > if (asyncStateMachine.asyncDispatch()) { > > > ((AprEndpoint)endpoint).processSocketAsync(this.socket, > > > SocketStatus.OPEN); > > > } > > > > > > In your example dispatching does not happen immediately as > > > asyncDispatch() call returns "false" and asyncStateMachine state > > > changes to AsyncState.MUST_DISPATCH. Thus your patch works. > > > > > > But, there is a case when the call returns "true" and dispatching > > > happens immediately. Such dispatching will be broken. > > > > Thanks for pointing this. > > > > > > > > BTW, I wonder if the following can be an alternative: > > > > > > if (this.dispatch != null) throw new IllegalStateException(".."); > > > > Unfortunately this will break another scenario: > > > > Servlet1 does dispatch to Servlet2 > > > > AsyncContext asyncContext = request.startAsync(request, response); > > asyncContext .dispatch("/Servlet2"); > > > > Servlet2 does dispatch to resourceA > > > > AsyncContext asyncContext = request.startAsync(request, response); > > asyncContext .dispatch("/Servlet2"); < here we still do not have invocation to AsyncContextImpl.recycle and AsyncContextImpl.dispatch field is not null > > > > > > So if we introduce a null check we will break double dispatch scenario. > > > > The solution might be to separate the check for state and the actual action invocation. > > Let's put this as plan B for now. > > I made a small change in the AsyncContextImpl.doInternalDispatch(). > > Can you comment on the patch? > > > Index: C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java > === > --- C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java (revision 1488110) > +++ C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java (working copy) > @@ -185,6 +185,10 @@ > logDebug("dispatch "); > } > check(); > +if (dispatch != null) { > +throw new IllegalStateException( > +sm.getString("asyncContextImpl.dispatchingStarted")); > +} > if (request.getAttribute(ASYNC_REQUEST_URI)==null) { > request.setAttribute(ASYNC_REQUEST_URI, request.getRequestURI()); > request.setAttribute(ASYNC_CONTEXT_PATH, request.getContextPath()); > @@ -347,7 +351,9 @@ > logDebug("intDispatch"); > } > try { > -dispatch.run(); > +Runnable runnable = dispatch; > +dispatch = null; > +runnable.run(); > if (!request.isAsync()) { > fireOnComplete(); > } > > Can you comment? Any other suggestions? Thanks > > > > Wdyt? > > > > Violeta > > > > > > > > Best regards, > > > Konstantin Kolinko > > > > > > - > > > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > > > For additional commands, e-mail: dev-h...@tomcat.apache.org > > > > > >
Re: AsyncContext.dispatch(path) invoked more than once
On 04/06/2013 13:55, Violeta Georgieva wrote: > 2013/5/31 Violeta Georgieva wrote: >> Let's put this as plan B for now. >> >> I made a small change in the AsyncContextImpl.doInternalDispatch(). >> >> Can you comment on the patch? >> >> >> Index: C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java >> === >> --- C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java > (revision 1488110) >> +++ C:/tc8.0.x/java/org/apache/catalina/core/AsyncContextImpl.java > (working copy) >> @@ -185,6 +185,10 @@ >> logDebug("dispatch "); >> } >> check(); >> +if (dispatch != null) { >> +throw new IllegalStateException( >> +sm.getString("asyncContextImpl.dispatchingStarted")); >> +} >> if (request.getAttribute(ASYNC_REQUEST_URI)==null) { >> request.setAttribute(ASYNC_REQUEST_URI, > request.getRequestURI()); >> request.setAttribute(ASYNC_CONTEXT_PATH, > request.getContextPath()); >> @@ -347,7 +351,9 @@ >> logDebug("intDispatch"); >> } >> try { >> -dispatch.run(); >> +Runnable runnable = dispatch; >> +dispatch = null; >> +runnable.run(); >> if (!request.isAsync()) { >> fireOnComplete(); >> } >> >> > > Can you comment? Looks good to me. > Any other suggestions? Nope :) Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489437 - in /tomcat/trunk/java/org/apache/coyote/http11: AbstractHttp11Processor.java LocalStrings.properties
Author: markt Date: Tue Jun 4 13:24:12 2013 New Revision: 1489437 URL: http://svn.apache.org/r1489437 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 Log errors parsing HTTP request headers. Modified: tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties 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=1489437&r1=1489436&r2=1489437&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java (original) +++ tomcat/trunk/java/org/apache/coyote/http11/AbstractHttp11Processor.java Tue Jun 4 13:24:12 2013 @@ -48,6 +48,7 @@ import org.apache.tomcat.util.buf.HexUti import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.http.FastHttpDateFormat; import org.apache.tomcat.util.http.MimeHeaders; +import org.apache.tomcat.util.log.UserDataHelper; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; import org.apache.tomcat.util.net.SocketStatus; @@ -57,6 +58,7 @@ import org.apache.tomcat.util.res.String public abstract class AbstractHttp11Processor extends AbstractProcessor { protected abstract Log getLog(); +private final UserDataHelper userDataHelper; /** @@ -238,6 +240,7 @@ public abstract class AbstractHttp11Proc public AbstractHttp11Processor(AbstractEndpoint endpoint) { super(endpoint); +userDataHelper = new UserDataHelper(getLog()); } @@ -952,9 +955,21 @@ public abstract class AbstractHttp11Proc break; } catch (Throwable t) { ExceptionUtils.handleThrowable(t); -if (getLog().isDebugEnabled()) { -getLog().debug( -sm.getString("http11processor.header.parse"), t); +UserDataHelper.Mode logMode = userDataHelper.getNextMode(); +if (logMode != null) { +String message = sm.getString( +"http11processor.header.parse"); +switch (logMode) { +case INFO_THEN_DEBUG: +message += sm.getString( +"http11processor.fallToDebug"); +//$FALL-THROUGH$ +case INFO: +getLog().info(message); +break; +case DEBUG: +getLog().debug(message); +} } // 400 - Bad Request response.setStatus(400); Modified: tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1489437&r1=1489436&r2=1489437&view=diff == --- tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/coyote/http11/LocalStrings.properties Tue Jun 4 13:24:12 2013 @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +http11processor.fallToDebug=\n Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. http11processor.header.parse=Error parsing HTTP request header http11processor.neverused=This method should never be used http11processor.request.prepare=Error preparing request - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489444 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/coyote/http11/AbstractHttp11Processor.java java/org/apache/coyote/http11/LocalStrings.properties webapps/docs/changelog.xml
Author: markt Date: Tue Jun 4 13:42:50 2013 New Revision: 1489444 URL: http://svn.apache.org/r1489444 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 Log errors parsing HTTP request headers using a UserDataHelper 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/java/org/apache/coyote/http11/LocalStrings.properties tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1489437 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=1489444&r1=1489443&r2=1489444&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 Tue Jun 4 13:42:50 2013 @@ -45,6 +45,7 @@ import org.apache.tomcat.util.buf.HexUti import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.http.FastHttpDateFormat; import org.apache.tomcat.util.http.MimeHeaders; +import org.apache.tomcat.util.log.UserDataHelper; import org.apache.tomcat.util.net.AbstractEndpoint; import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState; import org.apache.tomcat.util.net.SocketStatus; @@ -54,6 +55,7 @@ import org.apache.tomcat.util.res.String public abstract class AbstractHttp11Processor extends AbstractProcessor { protected abstract Log getLog(); +private final UserDataHelper userDataHelper; /** * The string manager for this package. @@ -263,6 +265,7 @@ public abstract class AbstractHttp11Proc public AbstractHttp11Processor(AbstractEndpoint endpoint) { super(endpoint); +userDataHelper = new UserDataHelper(getLog()); } @@ -966,9 +969,21 @@ public abstract class AbstractHttp11Proc break; } catch (Throwable t) { ExceptionUtils.handleThrowable(t); -if (getLog().isDebugEnabled()) { -getLog().debug( -sm.getString("http11processor.header.parse"), t); +UserDataHelper.Mode logMode = userDataHelper.getNextMode(); +if (logMode != null) { +String message = sm.getString( +"http11processor.header.parse"); +switch (logMode) { +case INFO_THEN_DEBUG: +message += sm.getString( +"http11processor.fallToDebug"); +//$FALL-THROUGH$ +case INFO: +getLog().info(message); +break; +case DEBUG: +getLog().debug(message); +} } // 400 - Bad Request response.setStatus(400); Modified: tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/LocalStrings.properties?rev=1489444&r1=1489443&r2=1489444&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/LocalStrings.properties (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/coyote/http11/LocalStrings.properties Tue Jun 4 13:42:50 2013 @@ -22,6 +22,7 @@ http11protocol.proto.socketexception.inf http11protocol.start=Starting Coyote HTTP/1.1 on {0} http11processor.regexp.error=Error parsing regular expression {0} +http11processor.fallToDebug=\n Note: further occurrences of HTTP header parsing errors will be logged at DEBUG level. http11processor.filter.unknown=Unknown filter {0} http11processor.filter.error=Error intializing filter {0} http11processor.header.parse=Error parsing HTTP request header 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=1489444&r1=1489443&r2=1489444&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Tue Jun 4 13:42:50 2013 @@ -74,6 +74,10 @@ Ensure that when auto deployment runs for a Host, it uses the latest values for copyXML, deployXML and unpackWARs. (markt) + +54939: Provide logging (using a UserDataHelper) when HTTP +header parsing fails (e.g. when maxHeaderCount is exceed
[Bug 54939] No useful logging when maxHeaderCount hit
https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 Mark Thomas changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #7 from Mark Thomas --- This has been fixed in trunk and 7.0.x and will be included in 7.0.41 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: r1489512 - /tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java
Author: kkolinko Date: Tue Jun 4 16:47:32 2013 New Revision: 1489512 URL: http://svn.apache.org/r1489512 Log: Wrap line. (Followup to r1489408) Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java?rev=1489512&r1=1489511&r2=1489512&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/juli/FileHandler.java Tue Jun 4 16:47:32 2013 @@ -374,7 +374,8 @@ public class FileHandler // Open the current log file writerLock.writeLock().lock(); FileOutputStream fos = null; -OutputStream os = null;try { +OutputStream os = null; +try { File pathname = new File(dir.getAbsoluteFile(), prefix + (rotatable ? date : "") + suffix); File parent = pathname.getParentFile(); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55052] [JULI] Make ClassLoaderLogManager.getProperty() to try unprefixed property if prefixed one does not exist
https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 --- Comment #2 from Konstantin Kolinko --- Created attachment 30387 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30387&action=edit 2013-06-04_tc6_55052.patch > Fixed in trunk and 7.0.x and will be included in 7.0.41 onwards. r1489405 and r1489411 Here is patch for Tomcat 6. It is backport of r1489405 -- 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: r1489524 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: kkolinko Date: Tue Jun 4 17:16:59 2013 New Revision: 1489524 URL: http://svn.apache.org/r1489524 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=1489524&r1=1489523&r2=1489524&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Jun 4 17:16:59 2013 @@ -68,6 +68,12 @@ PATCHES PROPOSED TO BACKPORT: +1: markt, kkolinko -1: +* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 + Make JULI's LogManager to additionally look for logging properties + without prefixes if the property cannot be found with a prefix. + +1: kkolinko + -1: + PATCHES/ISSUES THAT ARE STALLED - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489525 - /tomcat/tc6.0.x/trunk/STATUS.txt
Author: kkolinko Date: Tue Jun 4 17:19:35 2013 New Revision: 1489525 URL: http://svn.apache.org/r1489525 Log: Add link to the patch 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=1489525&r1=1489524&r2=1489525&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Jun 4 17:19:35 2013 @@ -71,6 +71,7 @@ PATCHES PROPOSED TO BACKPORT: * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=55052 Make JULI's LogManager to additionally look for logging properties without prefixes if the property cannot be found with a prefix. + https://issues.apache.org/bugzilla/attachment.cgi?id=30387 +1: kkolinko -1: - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489536 - in /tomcat/trunk: java/org/apache/catalina/core/AsyncContextImpl.java java/org/apache/catalina/core/LocalStrings.properties test/org/apache/catalina/core/TestAsyncContextImpl.ja
Author: violetagg Date: Tue Jun 4 18:03:04 2013 New Revision: 1489536 URL: http://svn.apache.org/r1489536 Log: IllegalStateException will be thrown if more than one asynchronous dispatch operation is started within the same asynchronous cycle. Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1489536&r1=1489535&r2=1489536&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Tue Jun 4 18:03:04 2013 @@ -185,6 +185,10 @@ public class AsyncContextImpl implements logDebug("dispatch "); } check(); +if (dispatch != null) { +throw new IllegalStateException( +sm.getString("asyncContextImpl.dispatchingStarted")); +} if (request.getAttribute(ASYNC_REQUEST_URI)==null) { request.setAttribute(ASYNC_REQUEST_URI, request.getRequestURI()); request.setAttribute(ASYNC_CONTEXT_PATH, request.getContextPath()); @@ -347,7 +351,9 @@ public class AsyncContextImpl implements logDebug("intDispatch"); } try { -dispatch.run(); +Runnable runnable = dispatch; +dispatch = null; +runnable.run(); if (!request.isAsync()) { fireOnComplete(); } Modified: tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1489536&r1=1489535&r2=1489536&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/trunk/java/org/apache/catalina/core/LocalStrings.properties Tue Jun 4 18:03:04 2013 @@ -66,6 +66,7 @@ aprListener.initializedOpenSSL=OpenSSL s asyncContextImpl.requestEnded=The request associated with the AsyncContext has already completed processing. asyncContextImpl.noAsyncDispatcher=The dispatcher returned from the ServletContext does not support asynchronous dispatching +asyncContextImpl.dispatchingStarted=Asynchronous dispatch operation has already been called. Additional asynchronous dispatch operation within the same asynchronous cycle is not allowed. containerBase.threadedStartFailed=A child container failed during start containerBase.threadedStopFailed=A child container failed during stop containerBase.backgroundProcess.cluster=Exception processing cluster {0} background process Modified: tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1489536&r1=1489535&r2=1489536&view=diff == --- tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original) +++ tomcat/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Tue Jun 4 18:03:04 2013 @@ -1720,4 +1720,63 @@ public class TestAsyncContextImpl extend // NO-OP } } + +@Test +public void testForbiddenDispatching() throws Exception { +// Setup Tomcat instance +Tomcat tomcat = getTomcatInstance(); + +// Must have a real docBase - just use temp +File docBase = new File(System.getProperty("java.io.tmpdir")); + +Context ctx = tomcat.addContext("", docBase.getAbsolutePath()); + +NonAsyncServlet nonAsyncServlet = new NonAsyncServlet(); +Wrapper wrapper = Tomcat.addServlet(ctx, "nonAsyncServlet", +nonAsyncServlet); +wrapper.setAsyncSupported(true); +ctx.addServletMapping("/nonAsyncServlet", "nonAsyncServlet"); + +ForbiddenDispatchingServlet forbiddenDispatchingServlet = new ForbiddenDispatchingServlet(); +Wrapper wrapper1 = Tomcat.addServlet(ctx, +"forbiddenDispatchingServlet", forbiddenDispatchingServlet); +wrapper1.setAsyncSupported(true); +ctx.addServletMapping("/forbiddenDispatchingServlet", +"forbiddenDispatchingServlet"); + +tomcat.start(); + +ByteChunk body = new ByteChunk(); + +try { +getUrl("http://localhost:"; + getPort() ++ "/forbiddenDispatchingServlet", body, null); +} catch (IOException ioe) { +// This may happen if test fails. Output the exception in case it is +// useful and
svn commit: r1489546 - /tomcat/trunk/build.properties.default
Author: kkolinko Date: Tue Jun 4 18:22:29 2013 New Revision: 1489546 URL: http://svn.apache.org/r1489546 Log: Update to Apache Commons Logging 1.1.3 If you svn diff 1_1_2 and 1_1_3 tags of commons-logging, the differences are - Documentation - Manifest and POM files (fix for LOGGING-151), irrelevant to us - Removal of some JARs from build.xml (r1483534), which we do not build either. - Versions of dependencies There have been no changes to the java code. Modified: tomcat/trunk/build.properties.default Modified: tomcat/trunk/build.properties.default URL: http://svn.apache.org/viewvc/tomcat/trunk/build.properties.default?rev=1489546&r1=1489545&r2=1489546&view=diff == --- tomcat/trunk/build.properties.default (original) +++ tomcat/trunk/build.properties.default Tue Jun 4 18:22:29 2013 @@ -75,25 +75,25 @@ base-maven.loc=http://repo2.maven.org/ma # base-sf.loc=http://sunet.dl.sourceforge.net # - Commons Logging, version 1.1 or later - -# If this version is updated, check the versions required for the deps +# If this version is updated, check the versions required for the dependencies below # - avalon-framework # - log4j # - logkit # - servletapi -commons-logging.version=1.1.2 +commons-logging.version=1.1.3 commons-logging.home=${base.path}/commons-logging-${commons-logging.version} commons-logging-src.loc.1=${base-commons.loc.1}/logging/source/commons-logging-${commons-logging.version}-src.tar.gz commons-logging-src.loc.2=${base-commons.loc.2}/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.version=4.1.5 avalon-framework.home=${base.path}/avalon-framework-${avalon-framework.version} avalon-framework.loc=${base-maven.loc}/avalon-framework/avalon-framework/${avalon-framework.version}/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.version=1.2.17 log4j.home=${base.path}/log4j-${log4j.version} log4j.loc=${base-maven.loc}/log4j/log4j/${log4j.version}/log4j-${log4j.version}.jar log4j.jar=${log4j.home}/log4j-${log4j.version}.jar - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489549 - /tomcat/trunk/java/org/apache/catalina/core/StandardHost.java
Author: markt Date: Tue Jun 4 18:32:13 2013 New Revision: 1489549 URL: http://svn.apache.org/r1489549 Log: Trivial clean-up Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHost.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHost.java?rev=1489549&r1=1489548&r2=1489549&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardHost.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHost.java Tue Jun 4 18:32:13 2013 @@ -461,7 +461,7 @@ public class StandardHost extends Contai */ public boolean isDeployXML() { -return (deployXML); +return deployXML; } @@ -481,7 +481,7 @@ public class StandardHost extends Contai */ public boolean isCopyXML() { -return (this.copyXML); +return this.copyXML; } @@ -493,7 +493,7 @@ public class StandardHost extends Contai */ public void setCopyXML(boolean copyXML) { -this.copyXML= copyXML; +this.copyXML = copyXML; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489557 - /tomcat/trunk/java/org/apache/catalina/connector/Response.java
Author: kkolinko Date: Tue Jun 4 18:46:52 2013 New Revision: 1489557 URL: http://svn.apache.org/r1489557 Log: Restore Javadoc to the getCoyoteResponse() method which has been deprecated, removed (r1188402) and resurrected (r1358055). This method is currently used by RewriteValve. BTW, one place where I see that getCoyoteResponse() method would be useful is to access response.getCoyoteResponse().getMimeHeaders(), e.g. to call removeHeader(String) which is not exposed via Servlet API. Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=1489557&r1=1489556&r2=1489557&view=diff == --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Tue Jun 4 18:46:52 2013 @@ -144,6 +144,9 @@ public class Response outputBuffer.setResponse(coyoteResponse); } +/** + * Get the Coyote response. + */ public org.apache.coyote.Response getCoyoteResponse() { return this.coyoteResponse; } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489561 - /tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
Author: kkolinko Date: Tue Jun 4 18:54:24 2013 New Revision: 1489561 URL: http://svn.apache.org/r1489561 Log: Remove @Deprecated marker from getCoyoteResponse() method as it has been resurrected in trunk in r1358055. It is currently used by RewriteValve in trunk and can be useful to valves to allow access to response.getCoyoteResponse().getMimeHeaders(). Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=1489561&r1=1489560&r2=1489561&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java Tue Jun 4 18:54:24 2013 @@ -175,7 +175,6 @@ public class Response /** * Get the Coyote response. */ -@Deprecated public org.apache.coyote.Response getCoyoteResponse() { return (coyoteResponse); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55017] Ability to configure RMI bind address
https://issues.apache.org/bugzilla/show_bug.cgi?id=55017 --- Comment #8 from Christopher Schultz --- (In reply to Mark Thomas from comment #7) > The patch needs to include the associated documentation changes. It would > also be nice if it used StringManager for i18n. Alexey, if you'd care to make those documentation patches and include them, it would be great. If not, someone else will do them but the patch will take longer to accept. Let us know if you need any instructions for how to do that: it's not hard, but just in case you needed some encouragement. Look at other classes in the same package for uses of StringManager: it's fairly simple. Basically, anything that is going to end up in a log file, shown to the user, etc. should be localized. Providing an English translation is usually sufficient, though it would be nice to provide Spanish and Japanese if you happen to be multilingual. -- 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 55017] Ability to configure RMI bind address
https://issues.apache.org/bugzilla/show_bug.cgi?id=55017 --- Comment #9 from Alexey Noskov --- Yes, I already found how it's used. I'll make documentation and i18n changes in nearest days. -- 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: r1489610 - /tomcat/trunk/webapps/docs/config/systemprops.xml
Author: kkolinko Date: Tue Jun 4 21:15:12 2013 New Revision: 1489610 URL: http://svn.apache.org/r1489610 Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 Follow-up to r1489444: Update description of UserDataHelper uses in documentation. Corrected a typo s/to/too/. Modified: tomcat/trunk/webapps/docs/config/systemprops.xml Modified: tomcat/trunk/webapps/docs/config/systemprops.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/config/systemprops.xml?rev=1489610&r1=1489609&r2=1489610&view=diff == --- tomcat/trunk/webapps/docs/config/systemprops.xml (original) +++ tomcat/trunk/webapps/docs/config/systemprops.xml Tue Jun 4 21:15:12 2013 @@ -484,7 +484,7 @@ The poll interval in milliseconds for the asynchronous logger thread in milliseconds. If the log queue is empty, the async thread will issue a poll(poll interval) - in order to not wake up to often. + in order to not wake up too often. The default value is 1000 milliseconds. @@ -500,7 +500,10 @@ The errors currently logged using this system are: invalid cookies; - invalid parameters. + invalid parameters; + too many headers, too many parameters (hitting + maxHeaderCount or maxParameterCount limits + of a connector). Other errors triggered by invalid input data may be added to this system in later versions. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489613 - in /tomcat/tc7.0.x/trunk: ./ webapps/docs/config/systemprops.xml
Author: kkolinko Date: Tue Jun 4 21:20:23 2013 New Revision: 1489613 URL: http://svn.apache.org/r1489613 Log: Merged r1489610 from tomcat/trunk: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=54939 Follow-up to r1489444: Update description of UserDataHelper uses in documentation. Correct a typo s/to/too/. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1489610 Modified: tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml?rev=1489613&r1=1489612&r2=1489613&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/config/systemprops.xml Tue Jun 4 21:20:23 2013 @@ -484,7 +484,7 @@ The poll interval in milliseconds for the asynchronous logger thread in milliseconds. If the log queue is empty, the async thread will issue a poll(poll interval) - in order to not wake up to often. + in order to not wake up too often. The default value is 1000 milliseconds. @@ -500,7 +500,10 @@ The errors currently logged using this system are: invalid cookies; - invalid parameters. + invalid parameters; + too many headers, too many parameters (hitting + maxHeaderCount or maxParameterCount limits + of a connector). Other errors triggered by invalid input data may be added to this system in later versions. - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
svn commit: r1489633 - /tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java
Author: markt Date: Tue Jun 4 21:42:12 2013 New Revision: 1489633 URL: http://svn.apache.org/r1489633 Log: Refactor WAR deployment to make a per Context copyXML attribute possible Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1489633&r1=1489632&r2=1489633&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Tue Jun 4 21:42:12 2013 @@ -784,68 +784,25 @@ public class HostConfig // Checking for a nested /META-INF/context.xml JarFile jar = null; -JarEntry entry = null; InputStream istream = null; FileOutputStream fos = null; BufferedOutputStream ostream = null; -File xml; -if (copyXML) { -xml = new File(host.getConfigBaseFile(), cn.getBaseName() + ".xml"); -} else { -xml = new File(host.getAppBaseFile(), -cn.getBaseName() + "/META-INF/context.xml"); -} -boolean xmlInWar = false; -if (deployXML && !xml.exists()) { +File xml = new File(host.getAppBaseFile(), +cn.getBaseName() + "/META-INF/context.xml"); + +boolean xmlInWar = false; +if (deployXML) { +JarEntry entry = null; try { jar = new JarFile(war); entry = jar.getJarEntry(Constants.ApplicationContextXml); if (entry != null) { xmlInWar = true; } -if ((copyXML || unpackWARs) && xmlInWar) { -istream = jar.getInputStream(entry); - -fos = new FileOutputStream(xml); -ostream = new BufferedOutputStream(fos, 1024); -byte buffer[] = new byte[1024]; -while (true) { -int n = istream.read(buffer); -if (n < 0) { -break; -} -ostream.write(buffer, 0, n); -} -ostream.flush(); -} } catch (IOException e) { /* Ignore */ } finally { -if (ostream != null) { -try { -ostream.close(); -} catch (IOException ioe) { -// Ignore -} -ostream = null; -} -if (fos != null) { -try { -fos.close(); -} catch (IOException ioe) { -// Ignore -} -fos = null; -} -if (istream != null) { -try { -istream.close(); -} catch (IOException ioe) { -// Ignore -} -istream = null; -} entry = null; if (jar != null) { try { @@ -858,17 +815,9 @@ public class HostConfig } } -DeployedApplication deployedApp = new DeployedApplication(cn.getName(), -xml.exists() && deployXML && copyXML); - -// Deploy the application in this WAR file -if(log.isInfoEnabled()) -log.info(sm.getString("hostConfig.deployWar", -war.getAbsolutePath())); - Context context = null; try { -if (deployXML && xml.exists()) { +if (deployXML && xml.exists() && !copyXML) { synchronized (digester) { try { context = (Context) digester.parse(xml); @@ -886,6 +835,7 @@ public class HostConfig context.setConfigFile(xml.toURI().toURL()); } else if (deployXML && xmlInWar) { synchronized (digester) { +JarEntry entry = null; try { jar = new JarFile(war); entry = @@ -926,7 +876,101 @@ public class HostConfig } else { context = (Context) Class.forName(contextClass).newInstance(); } +} catch (Throwable t) { +ExceptionUtils.handleThrowable(t); +log.error(sm.getString("hostConfig.deployWar.error", +war.getAbsolutePath()), t); +} finally { +if (context == null) { +context = new FailedContext(); +} +} + +boolean copyThisXml = false; +if
svn commit: r1489648 - in /tomcat/trunk/java/org/apache/catalina: core/StandardContext.java startup/HostConfig.java
Author: markt Date: Tue Jun 4 21:54:48 2013 New Revision: 1489648 URL: http://svn.apache.org/r1489648 Log: Add the ability for a context.xml file in a webapp to override the default value of copyXML on the host. There are some 'interesting' edge cases here. Test cases to follow. Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Modified: tomcat/trunk/java/org/apache/catalina/core/StandardContext.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardContext.java?rev=1489648&r1=1489647&r2=1489648&view=diff == --- tomcat/trunk/java/org/apache/catalina/core/StandardContext.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardContext.java Tue Jun 4 21:54:48 2013 @@ -486,6 +486,12 @@ public class StandardContext extends Con /** + * Context level override for default {@link StandardHost#isCopyXML()}. + */ +private boolean copyXML = false; + + +/** * The default context override flag for this web application. */ private boolean override = false; @@ -2376,6 +2382,17 @@ public class StandardContext extends Con } + +public boolean getCopyXML() { +return copyXML; +} + + +public void setCopyXML(boolean copyXML) { +this.copyXML = copyXML; +} + + /** * Return the Java class name of the Wrapper implementation used * for servlets registered in this Context. Modified: tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java?rev=1489648&r1=1489647&r2=1489648&view=diff == --- tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java (original) +++ tomcat/trunk/java/org/apache/catalina/startup/HostConfig.java Tue Jun 4 21:54:48 2013 @@ -53,6 +53,7 @@ import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; import org.apache.catalina.Manager; +import org.apache.catalina.core.StandardContext; import org.apache.catalina.core.StandardHost; import org.apache.catalina.util.ContextName; import org.apache.catalina.util.IOTools; @@ -892,14 +893,10 @@ public class HostConfig copyThisXml = ((StandardHost) host).isCopyXML(); } -/** - * TODO - * // If Host is using default value Context can override it. if (!copyXML && context instanceof StandardContext) { copyXML = ((StandardContext) context).getCopyXML(); } -*/ if (xmlInWar && copyThisXml) { // Change location of XML file to config base @@ -1084,8 +1081,7 @@ public class HostConfig new File(host.getConfigBaseFile(), cn.getBaseName() + ".xml"); -DeployedApplication deployedApp = new DeployedApplication(cn.getName(), -xml.exists() && deployXML && copyXML); +DeployedApplication deployedApp; try { if (deployXML && xml.exists()) { @@ -1103,6 +1099,12 @@ public class HostConfig digester.reset(); } } + +if (copyXML == false && context instanceof StandardContext) { +// Host is using default value. Context may override it. +copyXML = ((StandardContext) context).getCopyXML(); +} + if (copyXML) { InputStream is = null; OutputStream os = null; @@ -1146,6 +1148,9 @@ public class HostConfig log.error(sm.getString("hostConfig.deployDir.error", dir.getAbsolutePath()), t); } finally { +deployedApp = new DeployedApplication(cn.getName(), +xml.exists() && deployXML && copyXML); + // Fake re-deploy resource to detect if a WAR is added at a later // point deployedApp.redeployResources.put(dir.getAbsolutePath() + ".war", - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 55046] CORS Filter
https://issues.apache.org/bugzilla/show_bug.cgi?id=55046 --- Comment #6 from Mohit Soni --- Created attachment 30395 --> https://issues.apache.org/bugzilla/attachment.cgi?id=30395&action=edit Updated documentation filter.xml. I have reviewed the last patch, it looks fine to me functionality wise. I have updated the filter.xml to reflect change in class name from CORSFilter to CorsFilter, and have made other minor changes to documentation. Really excited to know that it's getting included in 7.0.41 as well. -- 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 55046] CORS Filter
https://issues.apache.org/bugzilla/show_bug.cgi?id=55046 Mohit Soni changed: What|Removed |Added Attachment #30395|0 |1 is patch|| -- 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: r1489706 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/core/AsyncContextImpl.java java/org/apache/catalina/core/LocalStrings.properties test/org/apache/catalina/core/TestAsyncCon
Author: violetagg Date: Wed Jun 5 05:02:38 2013 New Revision: 1489706 URL: http://svn.apache.org/r1489706 Log: Merged revision 1489536 from tomcat/trunk: IllegalStateException will be thrown if more than one asynchronous dispatch operation is started within the same asynchronous cycle. Modified: tomcat/tc7.0.x/trunk/ (props changed) tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Propchange: tomcat/tc7.0.x/trunk/ -- Merged /tomcat/trunk:r1489536 Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=1489706&r1=1489705&r2=1489706&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Wed Jun 5 05:02:38 2013 @@ -187,6 +187,10 @@ public class AsyncContextImpl implements logDebug("dispatch "); } check(); +if (dispatch != null) { +throw new IllegalStateException( +sm.getString("asyncContextImpl.dispatchingStarted")); +} if (request.getAttribute(ASYNC_REQUEST_URI)==null) { request.setAttribute(ASYNC_REQUEST_URI, request.getRequestURI()); request.setAttribute(ASYNC_CONTEXT_PATH, request.getContextPath()); @@ -350,7 +354,9 @@ public class AsyncContextImpl implements logDebug("intDispatch"); } try { -dispatch.run(); +Runnable runnable = dispatch; +dispatch = null; +runnable.run(); if (!request.isAsync()) { fireOnComplete(); } Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties?rev=1489706&r1=1489705&r2=1489706&view=diff == --- tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties (original) +++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/core/LocalStrings.properties Wed Jun 5 05:02:38 2013 @@ -73,6 +73,7 @@ aprListener.initializedOpenSSL=OpenSSL s asyncContextImpl.requestEnded=The request associated with the AsyncContext has already completed processing. asyncContextImpl.noAsyncDispatcher=The dispatcher returned from the ServletContext does not support asynchronous dispatching +asyncContextImpl.dispatchingStarted=Asynchronous dispatch operation has already been called. Additional asynchronous dispatch operation within the same asynchronous cycle is not allowed. containerBase.threadedStartFailed=A child container failed during start containerBase.threadedStopFailed=A child container failed during stop containerBase.backgroundProcess.cluster=Exception processing cluster {0} background process Modified: tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java?rev=1489706&r1=1489705&r2=1489706&view=diff == --- tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java (original) +++ tomcat/tc7.0.x/trunk/test/org/apache/catalina/core/TestAsyncContextImpl.java Wed Jun 5 05:02:38 2013 @@ -1721,4 +1721,63 @@ public class TestAsyncContextImpl extend // NO-OP } } + +@Test +public void testForbiddenDispatching() throws Exception { +// Setup Tomcat instance +Tomcat tomcat = getTomcatInstance(); + +// Must have a real docBase - just use temp +File docBase = new File(System.getProperty("java.io.tmpdir")); + +Context ctx = tomcat.addContext("", docBase.getAbsolutePath()); + +NonAsyncServlet nonAsyncServlet = new NonAsyncServlet(); +Wrapper wrapper = Tomcat.addServlet(ctx, "nonAsyncServlet", +nonAsyncServlet); +wrapper.setAsyncSupported(true); +ctx.addServletMapping("/nonAsyncServlet", "nonAsyncServlet"); + +ForbiddenDispatchingServlet forbiddenDispatchingServlet = new ForbiddenDispatchingServlet(); +Wrapper wrapper1 = Tomcat.addServlet(ctx, +"forbiddenDispatchingServlet", forbiddenDispatchingServlet); +wrapper1.setAsyncSupported(true); +ctx.addServletMapping("/forbiddenDispatchingServ
svn commit: r1489711 - /tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
Author: violetagg Date: Wed Jun 5 05:44:13 2013 New Revision: 1489711 URL: http://svn.apache.org/r1489711 Log: Fix typos. Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml 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=1489711&r1=1489710&r2=1489711&view=diff == --- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Wed Jun 5 05:44:13 2013 @@ -89,7 +89,7 @@ 54971: Ensure that the correct location is used when writing -files via avax.servlet.http.Part.write(String). (markt) +files via javax.servlet.http.Part.write(String). (markt) 54974: Ensure that @@ -116,7 +116,7 @@ parsed. (violetagg) -54999: The old JSESSIONIDSSAO needs to be removed when SSO is +54999: The old JSESSIONIDSSO needs to be removed when SSO is being used and logout() and login() occur within a single request. Patch provided by Keith Mashinter. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org