Re: JsonAccessLogValve
On Fri, Apr 21, 2023 at 7:15 PM Rainer Jung wrote: > > Hi all, > > I am looking at the new access log valve to add support for the pattern > fields with sub keys (headers, attributes etc.). Note: The valve uses the regular AccessLogValve. It could use ExtendedAccessLogValve instead, but I preferred simply fixing and merging rather than change things significantly right away. > Many of those have free text values, so ensuring correct encodig is > important. I noticed, that the AbstractAccessLogValve already does > almost correct JSON encoding and the Json one ensures correct JSON > encoding by again encoding the values coming out of the > AbstractAccessLogValve. So an encoded char in a header ends up as \\u... > in the log, not as \u > > Since the encoding of the base valve is already so close to JSON, I > wonder, whether we could remove the only difference that's there and > then get rid of the double encoding: a vertical tab gets encoded as "\v" > which is not known in JSON. For JSON it needs to get encoded using an \u > sequence. We do that already for most other rarely used control > characters. The only other characters that are simply "\"-escaped are > also allowed in that form in JSON, so are fine. > > So what about switching the encoding of vertical tab in the Abstract > valve to \u00? Of course for TC 11 that should not be a problem, but do > people think it would be OK to backport? It doesnt sound like a common > character to expect, \v is not so well-known as a representation and > using \u-style would be more consistent with any other characters. \v is > not even a valid Java character escape (though that's not a strong > argument here). > > WDYT? Ok for removing the difference but I don't quite see how to remove the double encoding right now. Remy > Thanks and regards, > > Rainer > > > - > To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org > For additional commands, e-mail: dev-h...@tomcat.apache.org > - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] reftel opened a new pull request, #611: Ensure brackets are closed in PoolProperties.toString
reftel opened a new pull request, #611: URL: https://github.com/apache/tomcat/pull/611 Fixes minor annoyance when analyzing log files -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[Bug 66507] Catalina version command not honoring JAVA_OPTS variable
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507 --- Comment #3 from Thomas Starlinger --- Hi. We're using an RMI agent to let JConsole connect to the Tomcat JVM. The agent is configured via JAVA_OPTS. Now, if I try to start version.sh resp. catalina.sh the system tries to start the agent which in turn tries to open a port and that fails because the port is already in use. -8<-8<-8<- Create RMI registry on port 8112 Exception in thread "main" java.lang.reflect.InvocationTargetException : Caused by: java.rmi.server.ExportException: Port already in use: 8112; nested exception is: java.net.BindException: Address already in use : -8<-8<-8<- Is there any method to do this without triggering the BindException? Regards Thomas -- 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 66507] Catalina version command not honoring JAVA_OPTS variable
https://bz.apache.org/bugzilla/show_bug.cgi?id=66507 --- Comment #4 from Eric Hamilton --- Thomas, Can you try moving the agent configuration to the CATALINA_OPTS variable? The CATALINA_OPTS variable is only used by the commands that start the Tomcat server, while the JAVA_OPTS variable is used for all Java commands. -- 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 66508] Tomcat after a GC pause causes the HTTP threads to be blocked to acquire a semaphore to process WebSockets connection closure.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66508 Boris Petrov changed: What|Removed |Added CC||boris_pet...@live.com -- 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
[GitHub] [tomcat] aooohan merged pull request #611: Ensure brackets are closed in PoolProperties.toString
aooohan merged PR #611: URL: https://github.com/apache/tomcat/pull/611 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch main updated: Ensure brackets are closed in PoolProperties.toString
This is an automated email from the ASF dual-hosted git repository. lihan pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/main by this push: new a3671d2e99 Ensure brackets are closed in PoolProperties.toString a3671d2e99 is described below commit a3671d2e99c1526e9943a16efede6cb8f2b8057a Author: Magnus Reftel AuthorDate: Mon Apr 24 12:41:51 2023 +0200 Ensure brackets are closed in PoolProperties.toString --- .../apache/tomcat/jdbc/pool/PoolProperties.java| 1 + .../tomcat/jdbc/pool/PoolPropertiesTest.java | 39 ++ 2 files changed, 40 insertions(+) diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java index e9c9c09b69..3aff37fa53 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java @@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl break; } } +buf.append(']'); }catch (Exception x) { //shouldn't happen log.debug("toString() call failed", x); diff --git a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java new file mode 100644 index 00..b475d64f23 --- /dev/null +++ b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java @@ -0,0 +1,39 @@ +package org.apache.tomcat.jdbc.pool; + + +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class PoolPropertiesTest { +private static final String DEFAULT_USER = "username_def"; +private static final String DEFAULT_PASSWD = "password_def"; +@Test +public void toStringOutputShouldHaveBalancedBrackets() { +PoolProperties properties = new PoolProperties(); +properties.setUsername(DEFAULT_USER); +properties.setPassword(DEFAULT_PASSWD); +properties.setAlternateUsernameAllowed(true); +properties.setInitialSize(0); +properties.setRemoveAbandoned(false); +properties.setTimeBetweenEvictionRunsMillis(-1); + +String asString = properties.toString(); + +List stack = new ArrayList<>(); +for (char c : asString.toCharArray()) { +switch (c) { +case '{': +case '(': +case '[': stack.add(c); break; +case '}': Assert.assertEquals('{', stack.remove(stack.size() - 1).charValue()); break; +case ')': Assert.assertEquals('(', stack.remove(stack.size() - 1).charValue()); break; +case ']': Assert.assertEquals('[', stack.remove(stack.size() - 1).charValue()); break; +default: break; +} +} +Assert.assertEquals("All brackets should have been closed", 0, stack.size()); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[GitHub] [tomcat] aooohan commented on pull request #611: Ensure brackets are closed in PoolProperties.toString
aooohan commented on PR #611: URL: https://github.com/apache/tomcat/pull/611#issuecomment-1521052913 Thanks for the PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 10.1.x updated: Ensure brackets are closed in PoolProperties.toString
This is an automated email from the ASF dual-hosted git repository. lihan pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/10.1.x by this push: new 7e93ea8206 Ensure brackets are closed in PoolProperties.toString 7e93ea8206 is described below commit 7e93ea82066868f1a08431ba7778376dd8773a0c Author: Magnus Reftel AuthorDate: Mon Apr 24 12:41:51 2023 +0200 Ensure brackets are closed in PoolProperties.toString --- .../apache/tomcat/jdbc/pool/PoolProperties.java| 1 + .../tomcat/jdbc/pool/PoolPropertiesTest.java | 39 ++ 2 files changed, 40 insertions(+) diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java index e9c9c09b69..3aff37fa53 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java @@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl break; } } +buf.append(']'); }catch (Exception x) { //shouldn't happen log.debug("toString() call failed", x); diff --git a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java new file mode 100644 index 00..b475d64f23 --- /dev/null +++ b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java @@ -0,0 +1,39 @@ +package org.apache.tomcat.jdbc.pool; + + +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class PoolPropertiesTest { +private static final String DEFAULT_USER = "username_def"; +private static final String DEFAULT_PASSWD = "password_def"; +@Test +public void toStringOutputShouldHaveBalancedBrackets() { +PoolProperties properties = new PoolProperties(); +properties.setUsername(DEFAULT_USER); +properties.setPassword(DEFAULT_PASSWD); +properties.setAlternateUsernameAllowed(true); +properties.setInitialSize(0); +properties.setRemoveAbandoned(false); +properties.setTimeBetweenEvictionRunsMillis(-1); + +String asString = properties.toString(); + +List stack = new ArrayList<>(); +for (char c : asString.toCharArray()) { +switch (c) { +case '{': +case '(': +case '[': stack.add(c); break; +case '}': Assert.assertEquals('{', stack.remove(stack.size() - 1).charValue()); break; +case ')': Assert.assertEquals('(', stack.remove(stack.size() - 1).charValue()); break; +case ']': Assert.assertEquals('[', stack.remove(stack.size() - 1).charValue()); break; +default: break; +} +} +Assert.assertEquals("All brackets should have been closed", 0, stack.size()); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 9.0.x updated: Ensure brackets are closed in PoolProperties.toString
This is an automated email from the ASF dual-hosted git repository. lihan pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/9.0.x by this push: new 8908c58089 Ensure brackets are closed in PoolProperties.toString 8908c58089 is described below commit 8908c5808987a071a0afb6da8ebff506bb1424e0 Author: Magnus Reftel AuthorDate: Mon Apr 24 12:41:51 2023 +0200 Ensure brackets are closed in PoolProperties.toString --- .../apache/tomcat/jdbc/pool/PoolProperties.java| 1 + .../tomcat/jdbc/pool/PoolPropertiesTest.java | 39 ++ 2 files changed, 40 insertions(+) diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java index e9c9c09b69..3aff37fa53 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java @@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl break; } } +buf.append(']'); }catch (Exception x) { //shouldn't happen log.debug("toString() call failed", x); diff --git a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java new file mode 100644 index 00..b475d64f23 --- /dev/null +++ b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java @@ -0,0 +1,39 @@ +package org.apache.tomcat.jdbc.pool; + + +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class PoolPropertiesTest { +private static final String DEFAULT_USER = "username_def"; +private static final String DEFAULT_PASSWD = "password_def"; +@Test +public void toStringOutputShouldHaveBalancedBrackets() { +PoolProperties properties = new PoolProperties(); +properties.setUsername(DEFAULT_USER); +properties.setPassword(DEFAULT_PASSWD); +properties.setAlternateUsernameAllowed(true); +properties.setInitialSize(0); +properties.setRemoveAbandoned(false); +properties.setTimeBetweenEvictionRunsMillis(-1); + +String asString = properties.toString(); + +List stack = new ArrayList<>(); +for (char c : asString.toCharArray()) { +switch (c) { +case '{': +case '(': +case '[': stack.add(c); break; +case '}': Assert.assertEquals('{', stack.remove(stack.size() - 1).charValue()); break; +case ')': Assert.assertEquals('(', stack.remove(stack.size() - 1).charValue()); break; +case ']': Assert.assertEquals('[', stack.remove(stack.size() - 1).charValue()); break; +default: break; +} +} +Assert.assertEquals("All brackets should have been closed", 0, stack.size()); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] branch 8.5.x updated: Ensure brackets are closed in PoolProperties.toString
This is an automated email from the ASF dual-hosted git repository. lihan pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git The following commit(s) were added to refs/heads/8.5.x by this push: new ccdb4995cd Ensure brackets are closed in PoolProperties.toString ccdb4995cd is described below commit ccdb4995cdf98362732664b4a5077af53926d2c6 Author: Magnus Reftel AuthorDate: Mon Apr 24 12:41:51 2023 +0200 Ensure brackets are closed in PoolProperties.toString --- .../apache/tomcat/jdbc/pool/PoolProperties.java| 1 + .../tomcat/jdbc/pool/PoolPropertiesTest.java | 39 ++ 2 files changed, 40 insertions(+) diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java index f333c3de59..73479e250c 100644 --- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java +++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PoolProperties.java @@ -848,6 +848,7 @@ public class PoolProperties implements PoolConfiguration, Cloneable, Serializabl break; } } +buf.append(']'); }catch (Exception x) { //shouldn't happen log.debug("toString() call failed", x); diff --git a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java new file mode 100644 index 00..b475d64f23 --- /dev/null +++ b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/pool/PoolPropertiesTest.java @@ -0,0 +1,39 @@ +package org.apache.tomcat.jdbc.pool; + + +import org.junit.Assert; +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; + +public class PoolPropertiesTest { +private static final String DEFAULT_USER = "username_def"; +private static final String DEFAULT_PASSWD = "password_def"; +@Test +public void toStringOutputShouldHaveBalancedBrackets() { +PoolProperties properties = new PoolProperties(); +properties.setUsername(DEFAULT_USER); +properties.setPassword(DEFAULT_PASSWD); +properties.setAlternateUsernameAllowed(true); +properties.setInitialSize(0); +properties.setRemoveAbandoned(false); +properties.setTimeBetweenEvictionRunsMillis(-1); + +String asString = properties.toString(); + +List stack = new ArrayList<>(); +for (char c : asString.toCharArray()) { +switch (c) { +case '{': +case '(': +case '[': stack.add(c); break; +case '}': Assert.assertEquals('{', stack.remove(stack.size() - 1).charValue()); break; +case ')': Assert.assertEquals('(', stack.remove(stack.size() - 1).charValue()); break; +case ']': Assert.assertEquals('[', stack.remove(stack.size() - 1).charValue()); break; +default: break; +} +} +Assert.assertEquals("All brackets should have been closed", 0, stack.size()); +} +} - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org