You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2019/10/01 13:54:09 UTC

[tomcat] branch 8.5.x updated (74cd321 -> a7e6a5d)

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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 02/02: Add logging

Posted by ma...@apache.org.
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 <ma...@apache.org>
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[tomcat] 01/02: Add logging

Posted by ma...@apache.org.
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 <ma...@apache.org>
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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org