svn commit: r1867852 - in /tomcat/site/trunk: docs/whoweare.html xdocs/whoweare.xml

2019-10-01 Thread woonsan
Author: woonsan
Date: Tue Oct  1 17:35:16 2019
New Revision: 1867852

URL: http://svn.apache.org/viewvc?rev=1867852=rev
Log:
Adding commiter name

Modified:
tomcat/site/trunk/docs/whoweare.html
tomcat/site/trunk/xdocs/whoweare.xml

Modified: tomcat/site/trunk/docs/whoweare.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/whoweare.html?rev=1867852=1867851=1867852=diff
==
--- tomcat/site/trunk/docs/whoweare.html (original)
+++ tomcat/site/trunk/docs/whoweare.html Tue Oct  1 17:35:16 2019
@@ -458,6 +458,13 @@ A complete list of all the Apache Commit
 
 
 
+
+
+Woonsan Ko (woonsan at apache.org)
+
+
+
+
 
 Emeritus PMC members
 

Modified: tomcat/site/trunk/xdocs/whoweare.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/xdocs/whoweare.xml?rev=1867852=1867851=1867852=diff
==
--- tomcat/site/trunk/xdocs/whoweare.xml (original)
+++ tomcat/site/trunk/xdocs/whoweare.xml Tue Oct  1 17:35:16 2019
@@ -147,6 +147,10 @@ A complete list of all the Apache Commit
 
 Huxing Zhang (huxing at apache.org)
 
+
+Woonsan Ko (woonsan at apache.org)
+
+
 
 
 



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



ApacheCon North America 2020, project participation

2019-10-01 Thread Rich Bowen
Hi, folks,

(Note: You're receiving this email because you're on the dev@ list for
one or more Apache Software Foundation projects.)

For ApacheCon North America 2019, we asked projects to participate in
the creation of project/topic specific tracks. This was very successful,
with about 15 projects stepping up to curate the content for their
track/summit/event.

We need to know if you're going to do the same for 2020. This informs
how large a venue we book for the event, how long the event runs, and
many other considerations.

If you intend to participate again in 2020, we need to hear from you on
the plann...@apachecon.com mailing list. This is not a firm commitment,
but we need to know if you're, say, 75% confident that you'll be
participating.

And, no, we do not have any details at all, but assume that it will be
in roughly the same calendar space as this year's event, ie, somewhere
in the August-October timeframe.

Thanks.

-- 
Rich Bowen
VP Conferences
The Apache Software Foundation
@apachecon

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63791] Incomplete response + Exceptions thrown when using NIO adapter

2019-10-01 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63791

Erik Beerepoot  changed:

   What|Removed |Added

 OS||All
 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #1 from Erik Beerepoot  ---
After more investigation, this seems to be specific to the spring actuator
endpoint functionality.

-- 
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 56974] jdbc-pool validation query defaultAutoCommit status

2019-10-01 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=56974

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #1 from Mark Thomas  ---
See https://github.com/apache/tomcat/pull/170

-- 
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 63778] Jre7Compat cannot find getPseudoColumns with zero parameters

2019-10-01 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63778

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|NEW |RESOLVED

--- Comment #2 from Mark Thomas  ---
Thanks for the report.

The original issue has been fixed in 7.0.x and I have added some logging to the
JreCompat classes that should detect if further bugs like this creep in in the
future.

The fix will be in 7.0.97 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



[GitHub] [tomcat] markt-asf closed pull request #209: BZ 63778: Jre7Compat cannot find getPseudoColumns with zero parameters

2019-10-01 Thread GitBox
markt-asf closed pull request #209: BZ 63778: Jre7Compat cannot find 
getPseudoColumns with zero parameters
URL: https://github.com/apache/tomcat/pull/209
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on issue #209: BZ 63778: Jre7Compat cannot find getPseudoColumns with zero parameters

2019-10-01 Thread GitBox
markt-asf commented on issue #209: BZ 63778: Jre7Compat cannot find 
getPseudoColumns with zero parameters
URL: https://github.com/apache/tomcat/pull/209#issuecomment-537074405
 
 
   Thanks for the PR. As written, it generates unnecessary WARN log messages. 
DEBUG level messages are fine to report - for example - Java 8 wasn't found but 
WARN is not. I have added some log messages but with a slightly different 
approach that logs an ERROR if a problem like BZ 63778 is detected but 
otherwise uses DEBUG logging.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 08/08: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63778

2019-10-01 Thread markt
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 1d91f94d2acd57ac5af3fb5ebc041b6871c54096
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:48:52 2019 +0100

Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63778

Use correct signature to look up DatabaseMetaData.getPseudoColumns()
---
 java/org/apache/tomcat/util/compat/Jre7Compat.java | 2 +-
 webapps/docs/changelog.xml | 7 +++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre7Compat.java 
b/java/org/apache/tomcat/util/compat/Jre7Compat.java
index 40f4a50..43513a9 100644
--- a/java/org/apache/tomcat/util/compat/Jre7Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre7Compat.java
@@ -85,7 +85,7 @@ class Jre7Compat extends JreCompat {
 m6 = Connection.class.getMethod("abort", Executor.class);
 m7 = Connection.class.getMethod("setNetworkTimeout", 
Executor.class, int.class);
 m8 = Connection.class.getMethod("getNetworkTimeout");
-m9 = DatabaseMetaData.class.getMethod("getPseudoColumns");
+m9 = DatabaseMetaData.class.getMethod("getPseudoColumns", 
String.class, String.class, String.class, String.class);
 m10 = 
DatabaseMetaData.class.getMethod("generatedKeyAlwaysReturned");
 m11 = ResultSet.class.getMethod("getObject", int.class, 
Class.class);
 m12 = ResultSet.class.getMethod("getObject", String.class, 
Class.class);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index bc95a19..c4e3fcd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -113,6 +113,13 @@
 63758: Include the XML schema for the tomcat-users.xml file
 in the binary distributions. (markt)
   
+  
+63778: When running on Java 7, use the correct signature to
+look up the DatabaseMetaData.getPseudoColumns() method and
+avoid the NullPointerExceptions caused by using the wrong
+method. Add error logging to detect similar bugs. Based on a pull
+request by liguoxiong. (markt)
+  
 
   
   


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 06/08: Re-order method lookup so error handling works as intended

2019-10-01 Thread markt
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 36c5d2ecea0dc3adaeb835f2ff66643126539f68
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:38:54 2019 +0100

Re-order method lookup so error handling works as intended
---
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java 
b/java/org/apache/tomcat/util/compat/Jre8Compat.java
index 8f0c5fd..867dbd5 100644
--- a/java/org/apache/tomcat/util/compat/Jre8Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java
@@ -49,9 +49,9 @@ class Jre8Compat extends Jre7Compat {
 
 // The class is Java6+...
 Class c2 = Class.forName("javax.net.ssl.SSLParameters");
-m1 = SSLServerSocket.class.getMethod("getSSLParameters");
 // ...but this method is Java8+
-m2 = c2.getMethod("setUseCipherSuitesOrder", boolean.class);
+m1 = c2.getMethod("setUseCipherSuitesOrder", boolean.class);
+m2 = SSLServerSocket.class.getMethod("getSSLParameters");
 m3 = SSLServerSocket.class.getMethod("setSSLParameters", c2);
 } catch (SecurityException e) {
 // Should never happen
@@ -68,8 +68,8 @@ class Jre8Compat extends Jre7Compat {
 // Must be pre-Java 7
 log.debug(sm.getString("jre8Compat.javaPre7"), e);
 }
-getSSLParametersMethod = m1;
-setUseCipherSuitesOrderMethod = m2;
+setUseCipherSuitesOrderMethod = m1;
+getSSLParametersMethod = m2;
 setSSLParametersMethod = m3;
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 04/08: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
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 3a4adaa45a0231bf8d853b51468e14a37a9e3dfd
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:14:08 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 73b2fe0..68be1db 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -70,6 +70,10 @@ class Jre9Compat extends Jre8Compat {
 Object o15 = null;
 
 try {
+// Order is important for the error handling below.
+// Must look up c1 first.
+c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
+
 Class moduleLayerClazz = Class.forName("java.lang.ModuleLayer");
 Class configurationClazz = 
Class.forName("java.lang.module.Configuration");
 Class resolvedModuleClazz = 
Class.forName("java.lang.module.ResolvedModule");
@@ -79,7 +83,6 @@ class Jre9Compat extends Jre8Compat {
 Method runtimeVersionMethod = 
JarFile.class.getMethod("runtimeVersion");
 Method majorMethod = versionClazz.getMethod("major");
 
-c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
 m4 = URLConnection.class.getMethod("setDefaultUseCaches", 
String.class, boolean.class);
 m5 = moduleLayerClazz.getMethod("boot");
 m6 = moduleLayerClazz.getMethod("configuration");
@@ -100,8 +103,13 @@ class Jre9Compat extends Jre8Compat {
 // Should never happen
 log.error(sm.getString("jre9Compat.unexpected"), e);
 } catch (ClassNotFoundException e) {
-// Must be pre-Java 9
-log.debug(sm.getString("jre9Compat.javaPre9"), e);
+if (c1 == null) {
+// Must be pre-Java 9
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre9Compat.unexpected"), e);
+}
 } catch (IllegalArgumentException e) {
 // Should never happen
 log.error(sm.getString("jre9Compat.unexpected"), e);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 05/08: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
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 3c7fe26c9e0d063a74480667714a2c5f318b8e47
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:18:44 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java 
b/java/org/apache/tomcat/util/compat/Jre8Compat.java
index 274e2a3..8f0c5fd 100644
--- a/java/org/apache/tomcat/util/compat/Jre8Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java
@@ -44,6 +44,9 @@ class Jre8Compat extends Jre7Compat {
 Method m2 = null;
 Method m3 = null;
 try {
+// Order is important for the error handling below.
+// Must look up m1 first.
+
 // The class is Java6+...
 Class c2 = Class.forName("javax.net.ssl.SSLParameters");
 m1 = SSLServerSocket.class.getMethod("getSSLParameters");
@@ -54,8 +57,13 @@ class Jre8Compat extends Jre7Compat {
 // Should never happen
 log.error(sm.getString("jre8Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Must be pre-Java 8
-log.debug(sm.getString("jre8Compat.javaPre8"), e);
+if (m1 == null) {
+// Must be pre-Java 8
+log.debug(sm.getString("jre8Compat.javaPre8"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre8Compat.unexpected"), e);
+}
 } catch (ClassNotFoundException e) {
 // Must be pre-Java 7
 log.debug(sm.getString("jre8Compat.javaPre7"), e);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/08: Add logging

2019-10-01 Thread markt
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 17cd18f62d30dda534fa5563db3eeba1a8a79874
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:54:00 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 8 +++-
 java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index dcfdbcd..73b2fe0 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -95,16 +95,22 @@ class Jre9Compat extends Jre8Compat {
 
 } catch (SecurityException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 } catch (ClassNotFoundException e) {
-// Must be Java 8
+// Must be pre-Java 9
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
 } catch (IllegalArgumentException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 } catch (IllegalAccessException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 } catch (InvocationTargetException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 }
 
 inaccessibleObjectExceptionClazz = c1;
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 323087c..658bb43 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -14,6 +14,8 @@
 # limitations under the License.
 
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
+jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 
9 JVM
+jre9Compat.unexpected=Failed to create references to Java 9 classes and methods
 
 jreCompat.noFlushableGzipOutputStream=Java Runtime does not support flushable 
GZIP output streams. You must use Java 7 or later to use this feature.
 jreCompat.noServerCipherSuiteOrder=Java Runtime does not support 
"useServerCipherSuitesOrder". You must use Java 8 or later to use this feature.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 07/08: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
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 9f5df15ea3d3957242558f219da50495481fd342
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:39:08 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre7Compat.java | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre7Compat.java 
b/java/org/apache/tomcat/util/compat/Jre7Compat.java
index f47c3af..40f4a50 100644
--- a/java/org/apache/tomcat/util/compat/Jre7Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre7Compat.java
@@ -74,6 +74,8 @@ class Jre7Compat extends JreCompat {
 Method m14 = null;
 Constructor c = null;
 try {
+// Order is important for the error handling below.
+// Must look up m1 first.
 m1 = Locale.class.getMethod("forLanguageTag", String.class);
 c = GZIPOutputStream.class.getConstructor(OutputStream.class, 
boolean.class);
 m2 = CallableStatement.class.getMethod("getObject", int.class, 
Class.class);
@@ -93,8 +95,13 @@ class Jre7Compat extends JreCompat {
 // Should never happen
 log.error(sm.getString("jre7Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Must be pre-Java 7
-log.debug(sm.getString("jre7Compat.javaPre7"), e);
+if (m1 == null) {
+// Must be pre-Java 7
+log.debug(sm.getString("jre7Compat.javaPre7"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre7Compat.unexpected"), e);
+}
 }
 forLanguageTagMethod = m1;
 gzipOutputStreamConstructor = c;


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 03/08: Add logging

2019-10-01 Thread markt
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 53ba262df40a210de0a047912d33865069e137b3
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:06:11 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre7Compat.java | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre7Compat.java 
b/java/org/apache/tomcat/util/compat/Jre7Compat.java
index 11c41f7..f47c3af 100644
--- a/java/org/apache/tomcat/util/compat/Jre7Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre7Compat.java
@@ -30,8 +30,15 @@ import java.util.Locale;
 import java.util.concurrent.Executor;
 import java.util.zip.GZIPOutputStream;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
+
 class Jre7Compat extends JreCompat {
 
+private static final Log log = LogFactory.getLog(Jre7Compat.class);
+private static final StringManager sm = 
StringManager.getManager(Jre7Compat.class);
+
 private static final int RUNTIME_MAJOR_VERSION = 7;
 
 private static final Method forLanguageTagMethod;
@@ -84,8 +91,10 @@ class Jre7Compat extends JreCompat {
 m14 = Statement.class.getMethod("isCloseOnCompletion");
 } catch (SecurityException e) {
 // Should never happen
+log.error(sm.getString("jre7Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Expected on Java < 7
+// Must be pre-Java 7
+log.debug(sm.getString("jre7Compat.javaPre7"), e);
 }
 forLanguageTagMethod = m1;
 gzipOutputStreamConstructor = c;


-
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 (3abe935 -> 1d91f94)

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 3abe935  Fix open transaction after validation
 new 17cd18f  Add logging
 new 5290b68  Add logging
 new 53ba262  Add logging
 new 3a4adaa  Try and detect bugs like BZ 63778
 new 3c7fe26  Try and detect bugs like BZ 63778
 new 36c5d2e  Re-order method lookup so error handling works as intended
 new 9f5df15  Try and detect bugs like BZ 63778
 new 1d91f94  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63778

The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/compat/Jre7Compat.java | 20 +--
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 30 +-
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 18 +++--
 .../tomcat/util/compat/LocalStrings.properties |  9 +++
 webapps/docs/changelog.xml |  7 +
 5 files changed, 74 insertions(+), 10 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/08: Add logging

2019-10-01 Thread markt
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 5290b68f064c44c24e73e07a0dc26582cc38eb5a
Author: Mark Thomas 
AuthorDate: Tue Oct 1 14:49:16 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 14 --
 java/org/apache/tomcat/util/compat/LocalStrings.properties |  7 +++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java 
b/java/org/apache/tomcat/util/compat/Jre8Compat.java
index 50eb138..274e2a3 100644
--- a/java/org/apache/tomcat/util/compat/Jre8Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java
@@ -23,8 +23,15 @@ import javax.net.ssl.SSLEngine;
 import javax.net.ssl.SSLParameters;
 import javax.net.ssl.SSLServerSocket;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
+
 class Jre8Compat extends Jre7Compat {
 
+private static final Log log = LogFactory.getLog(Jre8Compat.class);
+private static final StringManager sm = 
StringManager.getManager(Jre8Compat.class);
+
 private static final int RUNTIME_MAJOR_VERSION = 8;
 
 private static final Method getSSLParametersMethod;
@@ -45,10 +52,13 @@ class Jre8Compat extends Jre7Compat {
 m3 = SSLServerSocket.class.getMethod("setSSLParameters", c2);
 } catch (SecurityException e) {
 // Should never happen
+log.error(sm.getString("jre8Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Expected on Java < 8
+// Must be pre-Java 8
+log.debug(sm.getString("jre8Compat.javaPre8"), e);
 } catch (ClassNotFoundException e) {
-// Expected on Java < 7
+// Must be pre-Java 7
+log.debug(sm.getString("jre8Compat.javaPre7"), e);
 }
 getSSLParametersMethod = m1;
 setUseCipherSuitesOrderMethod = m2;
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 658bb43..1f671ba 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -13,6 +13,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+jre7Compat.javaPre7=Method not found so assuming code is running on a pre-Java 
7 JVM
+jre7Compat.unexpected=Failed to create references to Java 7 classes and methods
+
+jre8Compat.javaPre7=Class not found so assuming code is running on a pre-Java 
7 JVM
+jre8Compat.javaPre8=Method not found so assuming code is running on a pre-Java 
8 JVM
+jre8Compat.unexpected=Failed to create references to Java 8 classes and methods
+
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
 jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 
9 JVM
 jre9Compat.unexpected=Failed to create references to Java 9 classes and methods


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 0bcf094a2d25429f67c79ac8f32b0227a94a2016
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:14:08 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 7ad6f66..3bbdd12 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -77,6 +77,10 @@ class Jre9Compat extends Jre8Compat {
 Object o15 = null;
 
 try {
+// Order is important for the error handling below.
+// Must look up c1 first.
+c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
+
 Class moduleLayerClazz = Class.forName("java.lang.ModuleLayer");
 Class configurationClazz = 
Class.forName("java.lang.module.Configuration");
 Class resolvedModuleClazz = 
Class.forName("java.lang.module.ResolvedModule");
@@ -86,7 +90,6 @@ class Jre9Compat extends Jre8Compat {
 Method runtimeVersionMethod = 
JarFile.class.getMethod("runtimeVersion");
 Method majorMethod = versionClazz.getMethod("major");
 
-c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
 m2 = SSLParameters.class.getMethod("setApplicationProtocols", 
String[].class);
 m3 = SSLEngine.class.getMethod("getApplicationProtocol");
 m4 = URLConnection.class.getMethod("setDefaultUseCaches", 
String.class, boolean.class);
@@ -103,8 +106,13 @@ class Jre9Compat extends Jre8Compat {
 o15 = majorMethod.invoke(o14);
 
 } catch (ClassNotFoundException e) {
-// Must be pre-Java 9
-log.debug(sm.getString("jre9Compat.javaPre9"), e);
+if (c1 == null) {
+// Must be pre-Java 9
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre9Compat.unexpected"), e);
+}
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 log.error(sm.getString("jre9Compat.unexpected"), e);


-
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 (a7e6a5d -> 7c15360)

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from a7e6a5d  Add logging
 new 0bcf094  Try and detect bugs like BZ 63778
 new 7c15360  Try and detect bugs like BZ 63778

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 ++--
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 14 +++---
 2 files changed, 21 insertions(+), 5 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 7c15360234d03ee308ee6c8fe42c5442e8be5e36
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:18:44 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java 
b/java/org/apache/tomcat/util/compat/Jre8Compat.java
index a29abcd..e76ac35 100644
--- a/java/org/apache/tomcat/util/compat/Jre8Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java
@@ -46,6 +46,9 @@ class Jre8Compat extends JreCompat {
 Method m1 = null;
 Constructor c2 = null;
 try {
+// Order is important for the error handling below.
+// Must look up m1 first.
+
 // The class is Java6+...
 Class clazz1 = Class.forName("javax.net.ssl.SSLParameters");
 // ...but this method is Java8+
@@ -56,8 +59,13 @@ class Jre8Compat extends JreCompat {
 // Should never happen
 log.error(sm.getString("jre8Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Must be pre-Java 8
-log.debug(sm.getString("jre8Compat.javaPre8"), e);
+if (m1 == null) {
+// Must be pre-Java 8
+log.debug(sm.getString("jre8Compat.javaPre8"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre8Compat.unexpected"), e);
+}
 } catch (ClassNotFoundException e) {
 // Should never happen
 log.error(sm.getString("jre8Compat.unexpected"), e);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Try and detect bugs like BZ 63778

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 504c3e7  Try and detect bugs like BZ 63778
504c3e7 is described below

commit 504c3e7a3227ba637f1f88dbcdc3ff0c4d76a75c
Author: Mark Thomas 
AuthorDate: Tue Oct 1 15:14:08 2019 +0100

Try and detect bugs like BZ 63778
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 0987ff0..843c0e3 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -77,6 +77,10 @@ class Jre9Compat extends JreCompat {
 Object o15 = null;
 
 try {
+// Order is important for the error handling below.
+// Must look up c1 first.
+c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
+
 Class moduleLayerClazz = Class.forName("java.lang.ModuleLayer");
 Class configurationClazz = 
Class.forName("java.lang.module.Configuration");
 Class resolvedModuleClazz = 
Class.forName("java.lang.module.ResolvedModule");
@@ -86,7 +90,6 @@ class Jre9Compat extends JreCompat {
 Method runtimeVersionMethod = 
JarFile.class.getMethod("runtimeVersion");
 Method majorMethod = versionClazz.getMethod("major");
 
-c1 = 
Class.forName("java.lang.reflect.InaccessibleObjectException");
 m2 = SSLParameters.class.getMethod("setApplicationProtocols", 
String[].class);
 m3 = SSLEngine.class.getMethod("getApplicationProtocol");
 m4 = URLConnection.class.getMethod("setDefaultUseCaches", 
String.class, boolean.class);
@@ -103,8 +106,13 @@ class Jre9Compat extends JreCompat {
 o15 = majorMethod.invoke(o14);
 
 } catch (ClassNotFoundException e) {
-// Must be pre-Java 9
-log.debug(sm.getString("jre9Compat.javaPre9"), e);
+if (c1 == null) {
+// Must be pre-Java 9
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
+} else {
+// Should never happen - signature error in lookup?
+log.error(sm.getString("jre9Compat.unexpected"), e);
+}
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 log.error(sm.getString("jre9Compat.unexpected"), e);


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Add logging

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 98943df20e20b4d7320d433f3090606dec600b2f
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:54:00 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 4 +++-
 java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 ++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index a7a368e..7ad6f66 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -103,9 +103,11 @@ class Jre9Compat extends Jre8Compat {
 o15 = majorMethod.invoke(o14);
 
 } catch (ClassNotFoundException e) {
-// Must be Java 8
+// Must be pre-Java 9
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
+log.error(sm.getString("jre9Compat.unexpected"), e);
 }
 
 inaccessibleObjectExceptionClazz = c1;
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 5418804..7b89aa6 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -14,6 +14,8 @@
 # limitations under the License.
 
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
+jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 
9 JVM
+jre9Compat.unexpected=Failed to create references to Java 9 classes and methods
 
 jreCompat.noApplicationProtocol=Java Runtime does not support 
SSLEngine.getApplicationProtocol(). You must use Java 9 to use this feature.
 jreCompat.noApplicationProtocols=Java Runtime does not support 
SSLParameters.setApplicationProtocols(). You must use Java 9 to use this 
feature.


-
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 (74cd321 -> a7e6a5d)

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from 74cd321  Fix open transaction after validation
 new 98943df  Add logging
 new a7e6a5d  Add logging

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 +++-
 java/org/apache/tomcat/util/compat/Jre9Compat.java |  4 +++-
 java/org/apache/tomcat/util/compat/LocalStrings.properties |  5 +
 3 files changed, 19 insertions(+), 2 deletions(-)


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Add logging

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit a7e6a5d5d40a8d47fe0e8bec884f179bf75bfe10
Author: Mark Thomas 
AuthorDate: Tue Oct 1 14:49:16 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre8Compat.java | 12 +++-
 java/org/apache/tomcat/util/compat/LocalStrings.properties |  3 +++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre8Compat.java 
b/java/org/apache/tomcat/util/compat/Jre8Compat.java
index 478fb7c..a29abcd 100644
--- a/java/org/apache/tomcat/util/compat/Jre8Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre8Compat.java
@@ -27,8 +27,15 @@ import java.util.Map;
 import javax.net.ssl.SSLEngine;
 import javax.net.ssl.SSLParameters;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.res.StringManager;
+
 class Jre8Compat extends JreCompat {
 
+private static final Log log = LogFactory.getLog(Jre8Compat.class);
+private static final StringManager sm = 
StringManager.getManager(Jre8Compat.class);
+
 private static final int RUNTIME_MAJOR_VERSION = 8;
 
 private static final Method setUseCipherSuitesOrderMethod;
@@ -47,10 +54,13 @@ class Jre8Compat extends JreCompat {
 c2 = clazz2.getConstructor(URI.class, Map.class);
 } catch (SecurityException e) {
 // Should never happen
+log.error(sm.getString("jre8Compat.unexpected"), e);
 } catch (NoSuchMethodException e) {
-// Expected on Java < 8
+// Must be pre-Java 8
+log.debug(sm.getString("jre8Compat.javaPre8"), e);
 } catch (ClassNotFoundException e) {
 // Should never happen
+log.error(sm.getString("jre8Compat.unexpected"), e);
 }
 setUseCipherSuitesOrderMethod = m1;
 domainLoadStoreParameterConstructor = c2;
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 7b89aa6..27e392c 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -13,6 +13,9 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+jre8Compat.javaPre8=Class not found so assuming code is running on a pre-Java 
8 JVM
+jre8Compat.unexpected=Failed to create references to Java 8 classes and methods
+
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
 jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 
9 JVM
 jre9Compat.unexpected=Failed to create references to Java 9 classes and methods


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Fix i18n lookups. Thanks to remm.

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 4af9929  Fix i18n lookups. Thanks to remm.
4af9929 is described below

commit 4af9929dca55e71a360656cd4b1b8947e9b2b86a
Author: Mark Thomas 
AuthorDate: Tue Oct 1 13:45:33 2019 +0100

Fix i18n lookups. Thanks to remm.
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 730d107..0987ff0 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -104,10 +104,10 @@ class Jre9Compat extends JreCompat {
 
 } catch (ClassNotFoundException e) {
 // Must be pre-Java 9
-log.debug("jre9Compat.javaPre9", e);
+log.debug(sm.getString("jre9Compat.javaPre9"), e);
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
-log.error("jre9Compat.unexpected", e);
+log.error(sm.getString("jre9Compat.unexpected"), e);
 }
 
 inaccessibleObjectExceptionClazz = c1;


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [tomcat] branch master updated: Add logging

2019-10-01 Thread Mark Thomas
On 01/10/2019 13:01, Rémy Maucherat wrote:
> On Tue, Oct 1, 2019 at 1:54 PM  > wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> markt 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 d8063b3  Add logging
> d8063b3 is described below
> 
> commit d8063b35b0a10afa3c8c666c135f13b801071555
> Author: Mark Thomas mailto:ma...@apache.org>>
> AuthorDate: Tue Oct 1 12:54:00 2019 +0100
> 
>     Add logging
> ---
>  java/org/apache/tomcat/util/compat/Jre9Compat.java         | 2 ++
>  java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java
> b/java/org/apache/tomcat/util/compat/Jre9Compat.java
> index 193ea5b..8d8af88 100644
> --- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
> +++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
> @@ -104,8 +104,10 @@ class Jre9Compat extends JreCompat {
> 
>          } catch (ClassNotFoundException e) {
>              // Must be Java 8
> +            log.debug("jre9Compat.java8", e);
>          } catch (ReflectiveOperationException |
> IllegalArgumentException e) {
>              // Should never happen
> +            log.error("jre9Compat.unexpected", e);
> 
> 
> sm.getString is missing in both places. (since it's debug, it doesn't
> have to have i18n anyway imo)

Thanks. I'll fix that.

Fair point about debug. If it isn't translated it will use the English
so nothing is lost.

Mark


> 
> Rémy
>  
> 
>          }
> 
>          inaccessibleObjectExceptionClazz = c1;
> diff --git
> a/java/org/apache/tomcat/util/compat/LocalStrings.properties
> b/java/org/apache/tomcat/util/compat/LocalStrings.properties
> index 7d53957..b385a35 100644
> --- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
> +++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
> @@ -14,6 +14,8 @@
>  # limitations under the License.
> 
>  jre9Compat.invalidModuleUri=The module URI provided [{0}] could not
> be converted to a URL for the JarScanner to process
> +jre9Compat.java8=Class not found so assuming code is running on Java 8
> +jre9Compat.unexpected=Failed to create references to Java 9 classes
> and methods
> 
>  jreCompat.noApplicationProtocol=Java Runtime does not support
> SSLEngine.getApplicationProtocol(). You must use Java 9 to use this
> feature.
>  jreCompat.noApplicationProtocols=Java Runtime does not support
> SSLParameters.setApplicationProtocols(). You must use Java 9 to use
> this feature.
> 
> 
> -
> 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



[tomcat] branch master updated: Re-word to aid back-ports

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 35dc787  Re-word to aid back-ports
35dc787 is described below

commit 35dc787d477a4a7844a4ebd8d6e8608eba71211e
Author: Mark Thomas 
AuthorDate: Tue Oct 1 13:02:10 2019 +0100

Re-word to aid back-ports
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 4 ++--
 java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 8d8af88..730d107 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -103,8 +103,8 @@ class Jre9Compat extends JreCompat {
 o15 = majorMethod.invoke(o14);
 
 } catch (ClassNotFoundException e) {
-// Must be Java 8
-log.debug("jre9Compat.java8", e);
+// Must be pre-Java 9
+log.debug("jre9Compat.javaPre9", e);
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
 log.error("jre9Compat.unexpected", e);
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index b385a35..891782c 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -14,7 +14,7 @@
 # limitations under the License.
 
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
-jre9Compat.java8=Class not found so assuming code is running on Java 8
+jre9Compat.javaPre9=Class not found so assuming code is running on a pre-Java 
9 JVM
 jre9Compat.unexpected=Failed to create references to Java 9 classes and methods
 
 jreCompat.noApplicationProtocol=Java Runtime does not support 
SSLEngine.getApplicationProtocol(). You must use Java 9 to use this feature.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: [tomcat] branch master updated: Add logging

2019-10-01 Thread Rémy Maucherat
On Tue, Oct 1, 2019 at 1:54 PM  wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> markt 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 d8063b3  Add logging
> d8063b3 is described below
>
> commit d8063b35b0a10afa3c8c666c135f13b801071555
> Author: Mark Thomas 
> AuthorDate: Tue Oct 1 12:54:00 2019 +0100
>
> Add logging
> ---
>  java/org/apache/tomcat/util/compat/Jre9Compat.java | 2 ++
>  java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java
> b/java/org/apache/tomcat/util/compat/Jre9Compat.java
> index 193ea5b..8d8af88 100644
> --- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
> +++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
> @@ -104,8 +104,10 @@ class Jre9Compat extends JreCompat {
>
>  } catch (ClassNotFoundException e) {
>  // Must be Java 8
> +log.debug("jre9Compat.java8", e);
>  } catch (ReflectiveOperationException | IllegalArgumentException
> e) {
>  // Should never happen
> +log.error("jre9Compat.unexpected", e);
>

sm.getString is missing in both places. (since it's debug, it doesn't have
to have i18n anyway imo)

Rémy


>  }
>
>  inaccessibleObjectExceptionClazz = c1;
> diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties
> b/java/org/apache/tomcat/util/compat/LocalStrings.properties
> index 7d53957..b385a35 100644
> --- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
> +++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
> @@ -14,6 +14,8 @@
>  # limitations under the License.
>
>  jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be
> converted to a URL for the JarScanner to process
> +jre9Compat.java8=Class not found so assuming code is running on Java 8
> +jre9Compat.unexpected=Failed to create references to Java 9 classes and
> methods
>
>  jreCompat.noApplicationProtocol=Java Runtime does not support
> SSLEngine.getApplicationProtocol(). You must use Java 9 to use this feature.
>  jreCompat.noApplicationProtocols=Java Runtime does not support
> SSLParameters.setApplicationProtocols(). You must use Java 9 to use this
> feature.
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: dev-h...@tomcat.apache.org
>
>


[tomcat] branch master updated: Add logging

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 d8063b3  Add logging
d8063b3 is described below

commit d8063b35b0a10afa3c8c666c135f13b801071555
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:54:00 2019 +0100

Add logging
---
 java/org/apache/tomcat/util/compat/Jre9Compat.java | 2 ++
 java/org/apache/tomcat/util/compat/LocalStrings.properties | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/java/org/apache/tomcat/util/compat/Jre9Compat.java 
b/java/org/apache/tomcat/util/compat/Jre9Compat.java
index 193ea5b..8d8af88 100644
--- a/java/org/apache/tomcat/util/compat/Jre9Compat.java
+++ b/java/org/apache/tomcat/util/compat/Jre9Compat.java
@@ -104,8 +104,10 @@ class Jre9Compat extends JreCompat {
 
 } catch (ClassNotFoundException e) {
 // Must be Java 8
+log.debug("jre9Compat.java8", e);
 } catch (ReflectiveOperationException | IllegalArgumentException e) {
 // Should never happen
+log.error("jre9Compat.unexpected", e);
 }
 
 inaccessibleObjectExceptionClazz = c1;
diff --git a/java/org/apache/tomcat/util/compat/LocalStrings.properties 
b/java/org/apache/tomcat/util/compat/LocalStrings.properties
index 7d53957..b385a35 100644
--- a/java/org/apache/tomcat/util/compat/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/compat/LocalStrings.properties
@@ -14,6 +14,8 @@
 # limitations under the License.
 
 jre9Compat.invalidModuleUri=The module URI provided [{0}] could not be 
converted to a URL for the JarScanner to process
+jre9Compat.java8=Class not found so assuming code is running on Java 8
+jre9Compat.unexpected=Failed to create references to Java 9 classes and methods
 
 jreCompat.noApplicationProtocol=Java Runtime does not support 
SSLEngine.getApplicationProtocol(). You must use Java 9 to use this feature.
 jreCompat.noApplicationProtocols=Java Runtime does not support 
SSLParameters.setApplicationProtocols(). You must use Java 9 to use this 
feature.


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



buildbot success in on tomcat-trunk

2019-10-01 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4637

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] a12135124ec4be3f24d2eb089215c93c93b645a9
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] davoustp commented on issue #170: Connections validated without explicit validation query leave a transaction open

2019-10-01 Thread GitBox
davoustp commented on issue #170: Connections validated without explicit 
validation query leave a transaction open
URL: https://github.com/apache/tomcat/pull/170#issuecomment-536993033
 
 
   Thx Mark!


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Tag Tomcat 7

2019-10-01 Thread Mark Thomas
On 01/10/2019 12:17, Violeta Georgieva wrote:
> Hi Mark,
> 
> На вт, 1.10.2019 г. в 13:58 ч. Mark Thomas  > написа:
>>
>> On 01/10/2019 11:09, Violeta Georgieva wrote:
>> > Hi,
>> >
>> > I'm planning to tag Tomcat 7 later today.
>> > If you want to include something please reply here.
>>
>> I am just looking at PR #170 that should backport to 7.0.x. I should be
>> done in less than an hour.
>>
>> If you could delay the tag until after I have completed the back-port
>> that would be great. Don't worry if not.
> 
> Ok
> Just let me know when you are ready.

Thanks. I'm done.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Re: Tag Tomcat 7

2019-10-01 Thread Violeta Georgieva
Hi Mark,

На вт, 1.10.2019 г. в 13:58 ч. Mark Thomas  написа:
>
> On 01/10/2019 11:09, Violeta Georgieva wrote:
> > Hi,
> >
> > I'm planning to tag Tomcat 7 later today.
> > If you want to include something please reply here.
>
> I am just looking at PR #170 that should backport to 7.0.x. I should be
> done in less than an hour.
>
> If you could delay the tag until after I have completed the back-port
> that would be great. Don't worry if not.

Ok
Just let me know when you are ready.

Regards,
Violeta


[GitHub] [tomcat] markt-asf commented on a change in pull request #208: Fix typos

2019-10-01 Thread GitBox
markt-asf commented on a change in pull request #208: Fix typos
URL: https://github.com/apache/tomcat/pull/208#discussion_r330001555
 
 

 ##
 File path: java/org/apache/catalina/tribes/group/GroupChannel.java
 ##
 @@ -335,7 +335,7 @@ public void messageReceived(ChannelMessage msg) {
 if (channelListener != null && channelListener.accept(fwd, 
source)) {
 channelListener.messageReceived(fwd, source);
 delivered = true;
-//if the message was accepted by an RPC channel, that 
channel
+//if the message was accepted by a RPC channel, that 
channel
 //is responsible for returning the reply, otherwise we 
send an absence reply
 
 Review comment:
   This is correct. It is "an RPC channel" because R has a [vowel sound 
](https://www.quora.com/Which-is-correct-in-English-an-R-or-a-R) when 
pronounced.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on a change in pull request #208: Fix typos

2019-10-01 Thread GitBox
markt-asf commented on a change in pull request #208: Fix typos
URL: https://github.com/apache/tomcat/pull/208#discussion_r330001555
 
 

 ##
 File path: java/org/apache/catalina/tribes/group/GroupChannel.java
 ##
 @@ -335,7 +335,7 @@ public void messageReceived(ChannelMessage msg) {
 if (channelListener != null && channelListener.accept(fwd, 
source)) {
 channelListener.messageReceived(fwd, source);
 delivered = true;
-//if the message was accepted by an RPC channel, that 
channel
+//if the message was accepted by a RPC channel, that 
channel
 //is responsible for returning the reply, otherwise we 
send an absence reply
 
 Review comment:
   This is correct. It is "an RPR channel" because R has a [vowel sound 
](https://www.quora.com/Which-is-correct-in-English-an-R-or-a-R) when 
pronounced.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on a change in pull request #208: Fix typos

2019-10-01 Thread GitBox
markt-asf commented on a change in pull request #208: Fix typos
URL: https://github.com/apache/tomcat/pull/208#discussion_r330001647
 
 

 ##
 File path: java/org/apache/catalina/tribes/io/ObjectReader.java
 ##
 @@ -32,7 +32,7 @@
  * The object reader object is an object used in conjunction with
  * java.nio TCP messages. This object stores the message bytes in a
  * XByteBuffer until a full package has been received.
- * This object uses an XByteBuffer which is an extendable object buffer that 
also allows
+ * This object uses a XByteBuffer which is an extendable object buffer that 
also allows
  * for message encoding and decoding.
 
 Review comment:
   Same here. It is "an XByteBufer"


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf closed pull request #170: Connections validated without explicit validation query leave a transaction open

2019-10-01 Thread GitBox
markt-asf closed pull request #170: Connections validated without explicit 
validation query leave a transaction open
URL: https://github.com/apache/tomcat/pull/170
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on issue #170: Connections validated without explicit validation query leave a transaction open

2019-10-01 Thread GitBox
markt-asf commented on issue #170: Connections validated without explicit 
validation query leave a transaction open
URL: https://github.com/apache/tomcat/pull/170#issuecomment-536988063
 
 
   Thanks for the patch and especially for the test case. I made a few minor 
changes (formatting, debug logging, license header) and have applied the fix to 
master (9.0.x) and back-ported it to 8.5.x and 7.0.x.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
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 open transaction after validation

2019-10-01 Thread markt
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 3abe935  Fix open transaction after validation
3abe935 is described below

commit 3abe935c3ae5208c1c5e7fd3c9f05fe5fb6cd9d1
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:07:28 2019 +0100

Fix open transaction after validation

When connections are validated without an explicit validation query,
ensure that any transactions opened by the validation process are
committed.

Patch provided by Pascal Davoust.
---
 .../apache/tomcat/jdbc/pool/PooledConnection.java  |  50 +-
 .../apache/tomcat/jdbc/test/TestValidation.java| 650 +
 webapps/docs/changelog.xml |   9 +
 3 files changed, 696 insertions(+), 13 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
index 05f9025..5dd7f16 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
@@ -451,11 +451,13 @@ public class PooledConnection {
 }
 
 if (query == null) {
+boolean transactionCommitted = false;
 int validationQueryTimeout = 
poolProperties.getValidationQueryTimeout();
 if (validationQueryTimeout < 0) validationQueryTimeout = 0;
 try {
 if (connection.isValid(validationQueryTimeout)) {
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } else {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -470,9 +472,14 @@ public class PooledConnection {
 log.debug("isValid() failed.", e);
 }
 return false;
+} finally {
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
+}
 }
 }
 
+boolean transactionCommitted = false;
 Statement stmt = null;
 try {
 stmt = connection.createStatement();
@@ -485,6 +492,7 @@ public class PooledConnection {
 stmt.execute(query);
 stmt.close();
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } catch (Exception ex) {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -495,25 +503,41 @@ public class PooledConnection {
 if (stmt!=null)
 try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
 
-try {
-if(!connection.getAutoCommit()) {
-connection.rollback();
-}
-} catch (SQLException e) {
-// do nothing
-}
 } finally {
-try {
-if(!connection.getAutoCommit()) {
-connection.commit();
-}
-} catch (SQLException e) {
-// do nothing
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
 }
 }
 return false;
 } //validate
 
+
+private boolean silentlyCommitTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.commit();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to commit transaction", e);
+}
+return false;
+}
+
+
+private boolean silentlyRollbackTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.rollback();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to rollback transaction", e);
+}
+return false;
+}
+
+
 /**
  * The time limit for how long the object
  * can remain unused before it is released
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
new file mode 100644
index 000..a557b82
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
@@ -0,0 +1,650 @@
+/*
+ * 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 

[tomcat] branch 8.5.x updated: Fix open transaction after validation

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 74cd321  Fix open transaction after validation
74cd321 is described below

commit 74cd32167af11269ba47cc5e60f45c3ee1b79cdc
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:07:28 2019 +0100

Fix open transaction after validation

When connections are validated without an explicit validation query,
ensure that any transactions opened by the validation process are
committed.

Patch provided by Pascal Davoust.
---
 .../apache/tomcat/jdbc/pool/PooledConnection.java  |  50 +-
 .../apache/tomcat/jdbc/test/TestValidation.java| 650 +
 webapps/docs/changelog.xml |   9 +
 3 files changed, 696 insertions(+), 13 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
index b1103fc..69cf1f0 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
@@ -509,11 +509,13 @@ public class PooledConnection implements 
PooledConnectionMBean {
 }
 
 if (query == null) {
+boolean transactionCommitted = false;
 int validationQueryTimeout = 
poolProperties.getValidationQueryTimeout();
 if (validationQueryTimeout < 0) validationQueryTimeout = 0;
 try {
 if (connection.isValid(validationQueryTimeout)) {
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } else {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -528,9 +530,14 @@ public class PooledConnection implements 
PooledConnectionMBean {
 log.debug("isValid() failed.", e);
 }
 return false;
+} finally {
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
+}
 }
 }
 
+boolean transactionCommitted = false;
 Statement stmt = null;
 try {
 stmt = connection.createStatement();
@@ -543,6 +550,7 @@ public class PooledConnection implements 
PooledConnectionMBean {
 stmt.execute(query);
 stmt.close();
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } catch (Exception ex) {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -553,25 +561,41 @@ public class PooledConnection implements 
PooledConnectionMBean {
 if (stmt!=null)
 try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
 
-try {
-if(!connection.getAutoCommit()) {
-connection.rollback();
-}
-} catch (SQLException e) {
-// do nothing
-}
 } finally {
-try {
-if(!connection.getAutoCommit()) {
-connection.commit();
-}
-} catch (SQLException e) {
-// do nothing
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
 }
 }
 return false;
 } //validate
 
+
+private boolean silentlyCommitTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.commit();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to commit transaction", e);
+}
+return false;
+}
+
+
+private boolean silentlyRollbackTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.rollback();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to rollback transaction", e);
+}
+return false;
+}
+
+
 /**
  * The time limit for how long the object
  * can remain unused before it is released
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
new file mode 100644
index 000..a557b82
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
@@ -0,0 +1,650 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file 

[tomcat] branch master updated (b2291dc -> a121351)

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git.


from b2291dc  Fix alignment of start-up messages
 new 8545d38  Expand the coverage of the Simplified Chinese translations
 new a121351  Fix open transaction after validation

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../manager/host/LocalStrings_zh_CN.properties |   2 +-
 .../util/digester/LocalStrings_zh_CN.properties|   2 +-
 .../util/net/openssl/LocalStrings_zh_CN.properties |   1 +
 .../websocket/server/LocalStrings_zh_CN.properties |   1 +
 .../apache/tomcat/jdbc/pool/PooledConnection.java  |  50 +-
 .../apache/tomcat/jdbc/test/TestValidation.java| 650 +
 webapps/docs/changelog.xml |   9 +
 7 files changed, 700 insertions(+), 15 deletions(-)
 create mode 100644 
modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 01/02: Expand the coverage of the Simplified Chinese translations

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 8545d38cfdf26575b90c881e9df1e96c4a997657
Author: Mark Thomas 
AuthorDate: Tue Oct 1 10:00:51 2019 +0100

Expand the coverage of the Simplified Chinese translations
---
 java/org/apache/catalina/manager/host/LocalStrings_zh_CN.properties   | 2 +-
 java/org/apache/tomcat/util/digester/LocalStrings_zh_CN.properties| 2 +-
 java/org/apache/tomcat/util/net/openssl/LocalStrings_zh_CN.properties | 1 +
 java/org/apache/tomcat/websocket/server/LocalStrings_zh_CN.properties | 1 +
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/java/org/apache/catalina/manager/host/LocalStrings_zh_CN.properties 
b/java/org/apache/catalina/manager/host/LocalStrings_zh_CN.properties
index 06fd955..c9cccbc 100644
--- a/java/org/apache/catalina/manager/host/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/manager/host/LocalStrings_zh_CN.properties
@@ -65,7 +65,7 @@ 
htmlHostManagerServlet.helpHtmlManagerFile=../docs/html-host-manager-howto.html
 htmlHostManagerServlet.helpManager=主机管理器帮助
 htmlHostManagerServlet.helpManagerFile=../docs/host-manager-howto.html
 htmlHostManagerServlet.hostAliases=主机别名
-htmlHostManagerServlet.hostName=主机名
+htmlHostManagerServlet.hostName=主机名称
 htmlHostManagerServlet.hostTasks=命令
 htmlHostManagerServlet.hostThis=主机管理器已安装 - 命令不可用
 htmlHostManagerServlet.hostsRemove=移除
diff --git a/java/org/apache/tomcat/util/digester/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/util/digester/LocalStrings_zh_CN.properties
index f9c465b..ae5eeb4 100644
--- a/java/org/apache/tomcat/util/digester/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/util/digester/LocalStrings_zh_CN.properties
@@ -13,5 +13,5 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-digester.encodingInvalid=JRE无法识别编码 [{0}],将被忽略
+digester.encodingInvalid=Java运行时环境无法识别 [{0}]编码,将被忽略
 digester.failedToUpdateAttributes=属性[{0}]更新失败,旧数据为[{1}]
diff --git 
a/java/org/apache/tomcat/util/net/openssl/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/util/net/openssl/LocalStrings_zh_CN.properties
index 92e1245..3204e25 100644
--- a/java/org/apache/tomcat/util/net/openssl/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/util/net/openssl/LocalStrings_zh_CN.properties
@@ -23,6 +23,7 @@ engine.writeToSSLFailed=写入SSL失败,返回:[{0}]
 openssl.X509FactoryError=获取X509工厂实例时出错
 openssl.addedClientCaCert=添加了客户端 CA 证书:[{0}]
 openssl.errMakeConf=无法创建OpenSSLConf上下文
+openssl.keyManagerMissing=key管理器未找到
 openssl.trustManagerMissing=没有找到.信任管理者
 
 opensslconf.checkFailed=检查OpenSSLConf时失败。
diff --git 
a/java/org/apache/tomcat/websocket/server/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/websocket/server/LocalStrings_zh_CN.properties
index 2514775..71e80e2 100644
--- a/java/org/apache/tomcat/websocket/server/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/websocket/server/LocalStrings_zh_CN.properties
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 serverContainer.configuratorFail=无法为[{1}]类型的POJO创建类型[{0}]的配置程序
+serverContainer.encoderFail=无法创建[{0}]类型的编码器
 
serverContainer.failedDeployment=由于以前的部署失败,不允许将WebSocket终结点部署到主机[{1}]中路径为[{0}]的Web应用程序
 serverContainer.servletContextMissing=没有指定ServletContext
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] 02/02: Fix open transaction after validation

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit a12135124ec4be3f24d2eb089215c93c93b645a9
Author: Mark Thomas 
AuthorDate: Tue Oct 1 12:07:28 2019 +0100

Fix open transaction after validation

When connections are validated without an explicit validation query,
ensure that any transactions opened by the validation process are
committed.

Patch provided by Pascal Davoust.
---
 .../apache/tomcat/jdbc/pool/PooledConnection.java  |  50 +-
 .../apache/tomcat/jdbc/test/TestValidation.java| 650 +
 webapps/docs/changelog.xml |   9 +
 3 files changed, 696 insertions(+), 13 deletions(-)

diff --git 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
index 404c72e..8978810 100644
--- 
a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
+++ 
b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/PooledConnection.java
@@ -509,11 +509,13 @@ public class PooledConnection implements 
PooledConnectionMBean {
 }
 
 if (query == null) {
+boolean transactionCommitted = false;
 int validationQueryTimeout = 
poolProperties.getValidationQueryTimeout();
 if (validationQueryTimeout < 0) validationQueryTimeout = 0;
 try {
 if (connection.isValid(validationQueryTimeout)) {
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } else {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -528,9 +530,14 @@ public class PooledConnection implements 
PooledConnectionMBean {
 log.debug("isValid() failed.", e);
 }
 return false;
+} finally {
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
+}
 }
 }
 
+boolean transactionCommitted = false;
 Statement stmt = null;
 try {
 stmt = connection.createStatement();
@@ -543,6 +550,7 @@ public class PooledConnection implements 
PooledConnectionMBean {
 stmt.execute(query);
 stmt.close();
 this.lastValidated = now;
+transactionCommitted = silentlyCommitTransactionIfNeeded();
 return true;
 } catch (Exception ex) {
 if (getPoolProperties().getLogValidationErrors()) {
@@ -553,25 +561,41 @@ public class PooledConnection implements 
PooledConnectionMBean {
 if (stmt!=null)
 try { stmt.close();} catch (Exception ignore2){/*NOOP*/}
 
-try {
-if(!connection.getAutoCommit()) {
-connection.rollback();
-}
-} catch (SQLException e) {
-// do nothing
-}
 } finally {
-try {
-if(!connection.getAutoCommit()) {
-connection.commit();
-}
-} catch (SQLException e) {
-// do nothing
+if (!transactionCommitted) {
+silentlyRollbackTransactionIfNeeded();
 }
 }
 return false;
 } //validate
 
+
+private boolean silentlyCommitTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.commit();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to commit transaction", e);
+}
+return false;
+}
+
+
+private boolean silentlyRollbackTransactionIfNeeded() {
+try {
+if (!connection.getAutoCommit()) {
+connection.rollback();
+}
+return true;
+} catch (SQLException e) {
+log.debug("Failed to rollback transaction", e);
+}
+return false;
+}
+
+
 /**
  * The time limit for how long the object
  * can remain unused before it is released
diff --git 
a/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
new file mode 100644
index 000..a557b82
--- /dev/null
+++ 
b/modules/jdbc-pool/src/test/java/org/apache/tomcat/jdbc/test/TestValidation.java
@@ -0,0 +1,650 @@
+/*
+ * 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 

Re: Tag Tomcat 7

2019-10-01 Thread Mark Thomas
On 01/10/2019 11:09, Violeta Georgieva wrote:
> Hi,
> 
> I'm planning to tag Tomcat 7 later today.
> If you want to include something please reply here.

I am just looking at PR #170 that should backport to 7.0.x. I should be
done in less than an hour.

If you could delay the tag until after I have completed the back-port
that would be great. Don't worry if not.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Tag Tomcat 7

2019-10-01 Thread Violeta Georgieva
Hi,

I'm planning to tag Tomcat 7 later today.
If you want to include something please reply here.

Regards,
Violeta


buildbot failure in on tomcat-trunk

2019-10-01 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/4636

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] b2291dc4744051297dcc5bc133cf45ca54cf1c37
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




-
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: Fix alignment of start-up messages

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 8dbabe3  Fix alignment of start-up messages
8dbabe3 is described below

commit 8dbabe34e4f09b4a574f549ba6a38e0f9ebedf97
Author: Mark Thomas 
AuthorDate: Tue Oct 1 09:55:34 2019 +0100

Fix alignment of start-up messages
---
 .../apache/catalina/startup/LocalStrings_zh_CN.properties| 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties 
b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
index 563065c..fe9f3f9 100644
--- a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
@@ -88,13 +88,13 @@ userConfig.error=为用户 [{0}]部署web应用发生错误
 userConfig.start=用户配置:处理开始
 
 versionLoggerListener.catalina.home=CATALINA_HOME: {0}
-versionLoggerListener.java.home=Java 环境变量: {0}
-versionLoggerListener.os.arch=架构:  {0}
-versionLoggerListener.os.version=OS.版本:{0}
+versionLoggerListener.java.home=Java 环境变量: {0}
+versionLoggerListener.os.arch=架构:  {0}
+versionLoggerListener.os.version=OS.版本:   {0}
 versionLoggerListener.prop=系统属性:   {0} = {1}
-versionLoggerListener.serverInfo.server.built=服务器构建:  {0}
-versionLoggerListener.serverInfo.server.version=Server.服务器版本:{0}
+versionLoggerListener.serverInfo.server.built=服务器构建:{0}
+versionLoggerListener.serverInfo.server.version=Server.服务器版本: {0}
 versionLoggerListener.vm.vendor=JVM.供应商:{0}
-versionLoggerListener.vm.version=JVM 版本:   {0}
+versionLoggerListener.vm.version=JVM 版本:  {0}
 
 webAnnotationSet.invalidInjection=方法资源注入注解无效。


-
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 alignment of start-up messages

2019-10-01 Thread markt
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 cbf2694  Fix alignment of start-up messages
cbf2694 is described below

commit cbf2694cffeccf6d849d36264f15ea44aa65df2c
Author: Mark Thomas 
AuthorDate: Tue Oct 1 09:55:38 2019 +0100

Fix alignment of start-up messages
---
 .../apache/catalina/startup/LocalStrings_zh_CN.properties| 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties 
b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
index 8bc07cd..06046dc 100644
--- a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
@@ -85,13 +85,13 @@ userConfig.error=为用户 [{0}]部署web应用发生错误
 userConfig.start=用户配置:处理开始
 
 versionLoggerListener.catalina.home=CATALINA_HOME: {0}
-versionLoggerListener.java.home=Java 环境变量: {0}
-versionLoggerListener.os.arch=架构:  {0}
-versionLoggerListener.os.version=OS.版本:{0}
+versionLoggerListener.java.home=Java 环境变量: {0}
+versionLoggerListener.os.arch=架构:  {0}
+versionLoggerListener.os.version=OS.版本:   {0}
 versionLoggerListener.prop=系统属性:   {0} = {1}
-versionLoggerListener.serverInfo.server.built=服务器构建:  {0}
-versionLoggerListener.serverInfo.server.version=Server.服务器版本:{0}
+versionLoggerListener.serverInfo.server.built=服务器构建:{0}
+versionLoggerListener.serverInfo.server.version=Server.服务器版本: {0}
 versionLoggerListener.vm.vendor=JVM.供应商:{0}
-versionLoggerListener.vm.version=JVM 版本:   {0}
+versionLoggerListener.vm.version=JVM 版本:  {0}
 
 webAnnotationSet.invalidInjection=方法资源注入注解无效。


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch master updated: Fix alignment of start-up messages

2019-10-01 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt 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 b2291dc  Fix alignment of start-up messages
b2291dc is described below

commit b2291dc4744051297dcc5bc133cf45ca54cf1c37
Author: Mark Thomas 
AuthorDate: Tue Oct 1 09:55:28 2019 +0100

Fix alignment of start-up messages
---
 .../apache/catalina/startup/LocalStrings_zh_CN.properties| 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties 
b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
index e80855d..4ab9078 100644
--- a/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
+++ b/java/org/apache/catalina/startup/LocalStrings_zh_CN.properties
@@ -98,13 +98,13 @@ userConfig.error=为用户 [{0}]部署web应用发生错误
 userConfig.start=用户配置:处理开始
 
 versionLoggerListener.catalina.home=CATALINA_HOME: {0}
-versionLoggerListener.java.home=Java 环境变量: {0}
-versionLoggerListener.os.arch=架构:  {0}
-versionLoggerListener.os.version=OS.版本:{0}
+versionLoggerListener.java.home=Java 环境变量: {0}
+versionLoggerListener.os.arch=架构:  {0}
+versionLoggerListener.os.version=OS.版本:   {0}
 versionLoggerListener.prop=系统属性:   {0} = {1}
-versionLoggerListener.serverInfo.server.built=服务器构建:  {0}
-versionLoggerListener.serverInfo.server.version=Server.服务器版本:{0}
+versionLoggerListener.serverInfo.server.built=服务器构建:{0}
+versionLoggerListener.serverInfo.server.version=Server.服务器版本: {0}
 versionLoggerListener.vm.vendor=JVM.供应商:{0}
-versionLoggerListener.vm.version=JVM 版本:   {0}
+versionLoggerListener.vm.version=JVM 版本:  {0}
 
 webAnnotationSet.invalidInjection=方法资源注入注解无效。


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] lgxbslgx commented on issue #210: BZ 63792: The tomcat log contains garbled code because of i18n

2019-10-01 Thread GitBox
lgxbslgx commented on issue #210: BZ 63792: The tomcat log contains garbled 
code because of i18n
URL: https://github.com/apache/tomcat/pull/210#issuecomment-536931659
 
 
   I have seen the native2ascii just now. Sorry for wasting your time.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63792] The tomcat log contains garbled code because of i18n

2019-10-01 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63792

Mark Thomas  changed:

   What|Removed |Added

 Resolution|--- |INVALID
 Status|NEW |RESOLVED

--- Comment #1 from Mark Thomas  ---
During the build process, the UTF-8 property files are converted to correctly
escaped ISO-8859-1 via the native2ascii Ant task.

-- 
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] markt-asf commented on issue #210: BZ 63792: The tomcat log contains garbled code because of i18n

2019-10-01 Thread GitBox
markt-asf commented on issue #210: BZ 63792: The tomcat log contains garbled 
code because of i18n
URL: https://github.com/apache/tomcat/pull/210#issuecomment-536929089
 
 
   I've confirmed that the 9.0.x build handles this correctly and calls the Ant 
Task native2ascii to convert the property files at build time.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf closed pull request #210: BZ 63792: The tomcat log contains garbled code because of i18n

2019-10-01 Thread GitBox
markt-asf closed pull request #210: BZ 63792: The tomcat log contains garbled 
code because of i18n
URL: https://github.com/apache/tomcat/pull/210
 
 
   


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] markt-asf commented on issue #210: BZ 63792: The tomcat log contains garbled code because of i18n

2019-10-01 Thread GitBox
markt-asf commented on issue #210: BZ 63792: The tomcat log contains garbled 
code because of i18n
URL: https://github.com/apache/tomcat/pull/210#issuecomment-536916735
 
 
   This doesn't look right. While the properties files are stored in UTF-8 in 
source control, the build process should convert them to ISO-8859-1 with 
appropriate escapes so they work correctly with any Java version.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] lgxbslgx opened a new pull request #210: BZ 63792: The tomcat log contains garbled code because of i18n

2019-10-01 Thread GitBox
lgxbslgx opened a new pull request #210: BZ 63792: The tomcat log contains 
garbled code because of i18n
URL: https://github.com/apache/tomcat/pull/210
 
 
   Prevent garbled code when using ResourceBundle.


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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 63792] New: The tomcat log contains garbled code because of i18n

2019-10-01 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=63792

Bug ID: 63792
   Summary: The tomcat log contains garbled code because of i18n
   Product: Tomcat 9
   Version: 9.0.x
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Util
  Assignee: dev@tomcat.apache.org
  Reporter: lgxbs...@gmail.com
  Target Milestone: -

The tomcat log contains garbled code which is hard to read because of i18n. If
tomcat is running in China, an example log(tomcat start log) is shown below.

Actual log:
01-Oct-2019 13:54:06.909 信息 [main] org.apache.coyote.AbstractProtocol.start
å¼å§åè®®å¤çå¥æ["http-nio-8080"]
01-Oct-2019 13:54:06.925 信息 [main] org.apache.coyote.AbstractProtocol.start
å¼å§åè®®å¤çå¥æ["ajp-nio-8009"]

Expected log:
01-Oct-2019 14:15:21.385 信息 [main] org.apache.coyote.AbstractProtocol.start
开始协议处理句柄["http-nio-8080"]
01-Oct-2019 14:15:21.397 信息 [main] org.apache.coyote.AbstractProtocol.start
开始协议处理句柄["ajp-nio-8009"]

It is caused by org.apache.tomcat.util.res.StringManager#getString and
java.util.PropertyResourceBundle. Prior to java 9, the PropertyResourceBundle
loads properties using encoding ISO-8859-1. The encoding ISO-8859-1 can only
represent the Latin letters, not all characters. When we use languages which
are not based on Latin letters, such as Chinese, the garbled codes appear. 

Fortunately, Java 9 and later version fix this issue by using UTF-8 instead of
ISO-8859-1 by default. Tomcat should address this issue when users use previous
version of Java 9. This issue affects branch 7.0.x, 8.5.x, 9.0.x and all the
tomcat releases after i18n. I will submit a pull request later to fix it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org