What's the purpose of this exception?
>From Tomcat Embedded Core 9.0.26: @Override protected void doClose() { if (log.isDebugEnabled()) { log.debug("Calling [" + getEndpoint() + "].closeSocket([" + this + "])", new Exception()); } Which will log something like: DEBUG [http-nio-8080-exec-2] org.apache.tomcat.util.net.NioEndpoint Calling [org.apache.tomcat.util.net.NioEndpoint@654c1a54]. closeSocket([org.apache.tomcat.util.net.NioEndpoint$ NioSocketWrapper@39e9d240:org.apache.tomcat.util.net.NioChannel@78019ed5 :java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 remote=/127.0.0.1:39988]]) java.lang.Exception: null at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doClose(NioEndpoint.java:1165) [tomcat-embed-core-9.0.26.jar:9.0.26] at org.apache.tomcat.util.net.SocketWrapperBase.close(SocketWrapperBase.java:394) [tomcat-embed-core-9.0.26.jar:9.0.26] at org.apache.tomcat.util.net.NioEndpoint$Poller. cancelledKey(NioEndpoint.java:667) [tomcat-embed-core-9.0.26.jar:9.0.26] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592) [tomcat-embed-core-9.0.26.jar:9.0.26] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.26.jar:9.0.26] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_212] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_212] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.26.jar:9.0.26] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212] To print the stack trace next to the message? Why not only print the stack trace next to the log message using org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace for example? The presence of the `java.lang.Exception: null` in the logs is a bit misleading and confusing. Best regards, Behrang Saeedzadeh blog.behrang.org
Re: What's the purpose of this exception?
On October 26, 2019 9:34:58 AM UTC, Behrang Saeedzadeh wrote: >From Tomcat Embedded Core 9.0.26: > >@Override >protected void doClose() { > if (log.isDebugEnabled()) { > log.debug("Calling [" + getEndpoint() + "].closeSocket([" + this + >"])", new Exception()); > } > >Which will log something like: > >DEBUG [http-nio-8080-exec-2] >org.apache.tomcat.util.net.NioEndpoint >Calling [org.apache.tomcat.util.net.NioEndpoint@654c1a54]. >closeSocket([org.apache.tomcat.util.net.NioEndpoint$ >NioSocketWrapper@39e9d240:org.apache.tomcat.util.net.NioChannel@78019ed5 >:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 >remote=/127.0.0.1:39988]]) > >java.lang.Exception: null >at >org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.doClose(NioEndpoint.java:1165) >[tomcat-embed-core-9.0.26.jar:9.0.26] >at >org.apache.tomcat.util.net.SocketWrapperBase.close(SocketWrapperBase.java:394) >[tomcat-embed-core-9.0.26.jar:9.0.26] > at org.apache.tomcat.util.net.NioEndpoint$Poller. >cancelledKey(NioEndpoint.java:667) >[tomcat-embed-core-9.0.26.jar:9.0.26] >at >org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592) >[tomcat-embed-core-9.0.26.jar:9.0.26] >at >org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) >[tomcat-embed-core-9.0.26.jar:9.0.26] >at >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) >[na:1.8.0_212] >at >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) >[na:1.8.0_212] >at >org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) >[tomcat-embed-core-9.0.26.jar:9.0.26] > at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212] > >To print the stack trace next to the message? Why not only print the >stack >trace next to the log message using >org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace for >example? The presence of the `java.lang.Exception: null` in the logs is >a >bit misleading and confusing. > >Best regards, >Behrang Saeedzadeh >blog.behrang.org This is a repost of a message to the users@ list. It would have been better to wait a little longer for a reply there rather than repeating. Mark - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch master updated: Add javadoc for RewriteMap
This is an automated email from the ASF dual-hosted git repository. fschumacher pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/master by this push: new 3f9d9de Add javadoc for RewriteMap 3f9d9de is described below commit 3f9d9de8568d22e5614491af0ef731dbde38107c Author: Felix Schumacher AuthorDate: Sat Oct 26 12:24:03 2019 +0200 Add javadoc for RewriteMap --- .../apache/catalina/valves/rewrite/RewriteMap.java | 33 ++ 1 file changed, 33 insertions(+) diff --git a/java/org/apache/catalina/valves/rewrite/RewriteMap.java b/java/org/apache/catalina/valves/rewrite/RewriteMap.java index 428588c..551584b 100644 --- a/java/org/apache/catalina/valves/rewrite/RewriteMap.java +++ b/java/org/apache/catalina/valves/rewrite/RewriteMap.java @@ -16,9 +16,42 @@ */ package org.apache.catalina.valves.rewrite; +/** + * Interface for user defined lookup/replacement logic that can be defined in + * a {@code rewrite.config} file by a {@code RewriteMap} directive. Such a map + * can then be used by a {@code RewriteRule} defined in the same file. + * + * An example {@code rewrite.config} file could look like: + * + * + * RewriteMap uc example.UpperCaseMap + * + * RewriteRule ^/(.*)$ ${uc:$1} + * + * + * + * One parameter can be optionally appended to the {@code RewriteMap} directive. + * This could be used – for example – to specify a name of a file, that + * contains a lookup table used by the implementation of the map. + */ public interface RewriteMap { +/** + * Optional parameter that can be defined through the {@code RewriteMap} + * directive in the {@code rewrite.config} file. + * + * @param params the optional parameter + * @return value is currently ignored + */ public String setParameters(String params); +/** + * Maps a key to a replacement value. + * The method is free to return {@code null} to indicate, that the default + * value from the {@code RewriteRule} directive should be used. + * + * @param key used by the actual implementation to generate a mapped value + * @return mapped value or {@code null} + */ public String lookup(String key); } - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
Re: [tomcat] 01/03: Fix warnings with Java 6 caused by missing @Override annotations
On October 25, 2019 5:40:43 PM UTC, Phil Steitz wrote: >Sorry I missed all of these things. Is there a checkstyle or eclipse >config somewhere that I can use to make sure the next batch is clean? No need to apologise. This is as much personal whim as anything else. There are some standard Eclipse settings in res/ide-support/eclipse (or something like that). The aim is to get to zero earnings when configured with Java 6 but we aren't quite there yet. Mark > >Phil > >On 10/25/19 11:12 AM, ma...@apache.org wrote: >> This is an automated email from the ASF dual-hosted git repository. >> >> markt pushed a commit to branch 7.0.x >> in repository https://gitbox.apache.org/repos/asf/tomcat.git >> >> commit 9e612f96ecfd96e3e96f2ea95ce9500d03f96691 >> Author: Mark Thomas >> AuthorDate: Fri Oct 25 13:13:06 2019 +0200 >> >> Fix warnings with Java 6 caused by missing @Override annotations >> --- >> .../dbcp/dbcp/AbstractConnectionPoolTest.java | 90 +- >> .../tomcat/dbcp/dbcp/TestBasicDataSource.java | 112 >++-- >> .../tomcat/dbcp/dbcp/TesterCallableStatement.java | 111 > >> .../apache/tomcat/dbcp/dbcp/TesterConnection.java | 49 ++ >> .../tomcat/dbcp/dbcp/TesterDatabaseMetaData.java | 174 >+++ >> test/org/apache/tomcat/dbcp/dbcp/TesterDriver.java | 6 + >> .../tomcat/dbcp/dbcp/TesterPreparedStatement.java | 74 +++- >> .../apache/tomcat/dbcp/dbcp/TesterResultSet.java | 191 >- >> .../apache/tomcat/dbcp/dbcp/TesterStatement.java | 42 + >> 9 files changed, 747 insertions(+), 102 deletions(-) >> >> diff --git >a/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >b/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> index 758f4e5..7a5db76 100644 >> --- >a/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> +++ >b/test/org/apache/tomcat/dbcp/dbcp/AbstractConnectionPoolTest.java >> @@ -5,9 +5,9 @@ >>* 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. >> @@ -35,7 +35,7 @@ import junit.framework.TestCase; >> >> /** >>* Base test suite for DBCP pools. >> - * >> + * >>* @author Rodney Waldhoff >>* @author Sean C. Sullivan >>* @author John McNally >> @@ -47,6 +47,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> super(testName); >> } >> >> +@Override >> public void tearDown() throws Exception { >> super.tearDown(); >> // Close any connections opened by the test >> @@ -54,7 +55,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> Connection conn = (Connection) connections.pop(); >> try { >> conn.close(); >> -} catch (Exception ex) { >> +} catch (Exception ex) { >> // ignore >> } finally { >> conn = null; >> @@ -63,18 +64,18 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> } >> >> protected abstract Connection getConnection() throws Exception; >> - >> + >> protected int getMaxActive() { >> return 10; >> } >> - >> + >> protected long getMaxWait() { >> return 100L; >> } >> - >> + >> /** Connections opened during the course of a test */ >> protected Stack connections = new >Stack(); >> - >> + >> /** Acquire a connection and push it onto the connections stack >*/ >> protected Connection newConnection() throws Exception { >> Connection connection = getConnection(); >> @@ -82,7 +83,7 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> return connection; >> } >> >> -// --- Utility Methods - >> +// --- Utility Methods - >> >> protected String getUsername(Connection conn) throws >SQLException { >> Statement stmt = conn.createStatement(); >> @@ -93,14 +94,14 @@ public abstract class AbstractConnectionPoolTest >extends TestCase { >> return null; >> } >> >> -// --- tests - >> +// --- tests - >> >> public void testClearWarnings() throws Exception { >> Connection[] c = new Connection[getMaxActive()]; >> for (int i = 0; i < c.length; i++) { >> c[i] =
Re: What's the purpose of this exception?
I thought this mailing list better suited for the question as it's about Tomcat's source code. On Sat, 26 Oct. 2019, 9:16 pm Mark Thomas, wrote: > On October 26, 2019 9:34:58 AM UTC, Behrang Saeedzadeh < > behran...@gmail.com> wrote: > >From Tomcat Embedded Core 9.0.26: > > > >@Override > >protected void doClose() { > > if (log.isDebugEnabled()) { > > log.debug("Calling [" + getEndpoint() + "].closeSocket([" + this + > >"])", new Exception()); > > } > > > >Which will log something like: > > > >DEBUG [http-nio-8080-exec-2] > >org.apache.tomcat.util.net.NioEndpoint > >Calling [org.apache.tomcat.util.net.NioEndpoint@654c1a54]. > >closeSocket([org.apache.tomcat.util.net.NioEndpoint$ > >NioSocketWrapper@39e9d240:org.apache.tomcat.util.net.NioChannel@78019ed5 > >:java.nio.channels.SocketChannel[connected local=/127.0.0.1:8080 > >remote=/127.0.0.1:39988]]) > > > >java.lang.Exception: null > >at > >org.apache.tomcat.util.net > .NioEndpoint$NioSocketWrapper.doClose(NioEndpoint.java:1165) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > >at > >org.apache.tomcat.util.net > .SocketWrapperBase.close(SocketWrapperBase.java:394) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > > at org.apache.tomcat.util.net.NioEndpoint$Poller. > >cancelledKey(NioEndpoint.java:667) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > >at > >org.apache.tomcat.util.net > .NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1592) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > >at > >org.apache.tomcat.util.net > .SocketProcessorBase.run(SocketProcessorBase.java:49) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > >at > > >java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) > >[na:1.8.0_212] > >at > > >java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) > >[na:1.8.0_212] > >at > > >org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) > >[tomcat-embed-core-9.0.26.jar:9.0.26] > > at java.lang.Thread.run(Thread.java:748) [na:1.8.0_212] > > > >To print the stack trace next to the message? Why not only print the > >stack > >trace next to the log message using > >org.apache.commons.lang3.exception.ExceptionUtils.getStackTrace for > >example? The presence of the `java.lang.Exception: null` in the logs is > >a > >bit misleading and confusing. > > > >Best regards, > >Behrang Saeedzadeh > >blog.behrang.org > > This is a repost of a message to the users@ list. It would have been > better to wait a little longer for a reply there rather than repeating. > > Mark > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > >
[Bug 63884] New: aaa
https://bz.apache.org/bugzilla/show_bug.cgi?id=63884 Bug ID: 63884 Summary: aaa Product: Tomcat Native Version: 1.2.19 Hardware: PC Status: NEW Severity: normal Priority: P2 Component: Library Assignee: dev@tomcat.apache.org Reporter: 46931...@email.yunser.net Target Milestone: --- Created attachment 36863 --> https://bz.apache.org/bugzilla/attachment.cgi?id=36863&action=edit 9 aa -- 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 63879] Unessesary log noise under DEBUG
https://bz.apache.org/bugzilla/show_bug.cgi?id=63879 --- Comment #3 from Steve Sanders --- Ive submitted a patch for this: https://github.com/apache/tomcat/pull/220 -- 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 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java
https://bz.apache.org/bugzilla/show_bug.cgi?id=63836 Mark Thomas changed: What|Removed |Added OS||All --- Comment #4 from Mark Thomas --- Oh, the irony. The problem is that the 1MB reserved by the OOME parachute is not released. Hopefully, I'll have a fix for this 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
[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63836
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/7.0.x by this push: new b338d34 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63836 b338d34 is described below commit b338d343c22c573d4069c172f572a7a88c7ba20b Author: Mark Thomas AuthorDate: Sat Oct 26 22:30:21 2019 +0200 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63836 Ensure that the memory reserved for the OOME parachute is released when the NIO endpoint is stopped. --- java/org/apache/tomcat/util/net/NioEndpoint.java | 1 + webapps/docs/changelog.xml | 4 2 files changed, 5 insertions(+) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index eeeb6b8..0eef5f6 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -592,6 +592,7 @@ public class NioEndpoint extends AbstractEndpoint { nioChannels.clear(); processorCache.clear(); shutdownExecutor(); +oomParachuteData = null; } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a1cf0a4..d459c50 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -98,6 +98,10 @@ Ensure that only a full token is matched and that the match is case insensitive. (markt) + +63836: Ensure that the memory reserved for the OOME parachute +is released when the NIO endpoint is stopped. (markt) + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java
https://bz.apache.org/bugzilla/show_bug.cgi?id=63836 Mark Thomas changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Mark Thomas --- Fixed in 7.0.x for 7.0.98 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
Re: [Bug 63836] TestWebdavServletOptions test fails with OutOfMemoryError for NIO on 32-bit Java
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Mark, On 10/26/19 16:15, bugzi...@apache.org wrote: > https://bz.apache.org/bugzilla/show_bug.cgi?id=63836 > > Mark Thomas changed: > > What|Removed |Added > -- - -- > > OS||All > > --- Comment #4 from Mark Thomas --- Oh, the > irony. > > The problem is that the 1MB reserved by the OOME parachute is not > released. LOL I'm reminded of this headline form The Onion: https://www.theonion.com/buddy-system-responsible-for-additional-death-1 819587195 (It's a headline only; there is no article) - -chris -BEGIN PGP SIGNATURE- Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/ iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl20tAUACgkQHPApP6U8 pFj+nA//S+qLb9awulKwl9mPL/GxcQDLwcjGfJ0nEk1sWhp21NuWGAOWVV297QkI dhF73Qn0VkO9r/Noh/E5Nfl2t0kkrMUlnaLGRKYYzFWmsCW/gxqZB6OGkvnBXR/Y oUP8QYAZDy01QtcZipl8ypACsfzrzSIsA1mTPGLF1BSCWkmEdsFw4hXyVV72NdEG JNB7Blk6M9ac+9qluqxdHl2DZv/8qsdOo9dghIIQcuPFHjfRasjO6q8aIRbBRqcQ OrJjYiSW+ZRnITf8WdQ9VBetqPPGx36CiSd6Eqz7wqCi3w8eIiBU9osmRzK6bc/t HtKngWmy4pHp7ymL+i+ueLqyfFhfi/mKsB2QhgJ2awnSdmUH7mtQqAtT0V0k+pyY LKdoXglr3iB68jGk/zdXR0lAcqtVgd2EttffFs0g5tBegnS8t8triykA4hHgSbMh QL9Pu+H3rIiFaex868jWBzS2dqF54DvRttsTeqqR/OtREPocP4OLh3ajo3iyRIEP u5f0UBGXKLlOtVxu0uJDaYV6Wrp2kw8dAiaT442PIEq1ejC6UMJUNYry2RPLzttk wVvfdU9Y6ZdIY/SDZ7lKnrJ+QBRAGbod3kSRPNAxcmj4BNja5rq3jzcpN+faUPus P1DhJAZFKV/zW7QChpkkKLdz3JgPLn5WVxG+7w0TOwGOrvfoKQg= =bNTg -END PGP SIGNATURE- - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 63884] aaa
https://bz.apache.org/bugzilla/show_bug.cgi?id=63884 Azat changed: What|Removed |Added OS||All Resolution|--- |INVALID Status|NEW |RESOLVED -- 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