-
Bug
-
Resolution: Fixed
-
P2
-
10
-
b38
-
b01
-
x86_64
-
linux
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8204114 | 10u-cpu | Daniel Fuchs | P2 | Resolved | Fixed | master |
JDK-8204111 | 10.0.2 | Daniel Fuchs | P2 | Closed | Fixed | b09 |
JDK-8202819 | 10u-open | Daniel Fuchs | P2 | Resolved | Fixed | master |
FULL PRODUCT VERSION :
java version "10-ea" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10-ea+38)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10-ea+38, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux study04 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
Apache Tomcat, any currently supported version.
A DESCRIPTION OF THE PROBLEM :
Apache Tomcat provides a custom LogManager that is class loader aware. This is done to avoid issues of log mix-up where multiple web applications (each with their own class loader) create Loggers with the same name.
The custom LogManager also permits multiple instances of the same Handler class to be created. It does this by the addition of a numerical prefix to the handler class name. As a result it treats the "handlers" and ".handlers" properties differently. The first defines all handlers, the second the handlers for the root logger.
With the fix forJDK-8191033, the JRE provided LogManager class now tries to process the ".handlers" property. Because it sees a class name of, for example, "1catalina.org.apache.juli.AsyncFileHandler" it throws a CNFE.
I've spent some time looking at the JRE LogManager implementation and I can see any easy way for a custom LogManager to work-around this.
The simplest solution from my PoV would be to make createLoggerHandlers() protected so custom LogManager implementations take take appropriate action as necessary.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Download any current version of Apache Tomcat.
Start it with Java 10 ea 38
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Clean start shown in logs / on console
ACTUAL -
The start-up log / console includes the following stack trace:
Can't load log handler "1catalina.org.apache.juli.AsyncFileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.AsyncFileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.AsyncFileHandler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.logging/java.util.logging.LogManager.createLoggerHandlers(LogManager.java:1005)
at java.logging/java.util.logging.LogManager.access$1000(LogManager.java:155)
at java.logging/java.util.logging.LogManager$2.run(LogManager.java:401)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:382)
at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:436)
at java.logging/java.util.logging.Logger.demandLogger(Logger.java:648)
at java.logging/java.util.logging.Logger.getLogger(Logger.java:717)
at java.logging/java.util.logging.Logger.getLogger(Logger.java:701)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:68)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:188)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
See above.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None found.
java version "10-ea" 2018-03-20
Java(TM) SE Runtime Environment 18.3 (build 10-ea+38)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10-ea+38, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Linux study04 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
EXTRA RELEVANT SYSTEM CONFIGURATION :
Apache Tomcat, any currently supported version.
A DESCRIPTION OF THE PROBLEM :
Apache Tomcat provides a custom LogManager that is class loader aware. This is done to avoid issues of log mix-up where multiple web applications (each with their own class loader) create Loggers with the same name.
The custom LogManager also permits multiple instances of the same Handler class to be created. It does this by the addition of a numerical prefix to the handler class name. As a result it treats the "handlers" and ".handlers" properties differently. The first defines all handlers, the second the handlers for the root logger.
With the fix for
I've spent some time looking at the JRE LogManager implementation and I can see any easy way for a custom LogManager to work-around this.
The simplest solution from my PoV would be to make createLoggerHandlers() protected so custom LogManager implementations take take appropriate action as necessary.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Download any current version of Apache Tomcat.
Start it with Java 10 ea 38
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Clean start shown in logs / on console
ACTUAL -
The start-up log / console includes the following stack trace:
Can't load log handler "1catalina.org.apache.juli.AsyncFileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.AsyncFileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.AsyncFileHandler
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
at java.logging/java.util.logging.LogManager.createLoggerHandlers(LogManager.java:1005)
at java.logging/java.util.logging.LogManager.access$1000(LogManager.java:155)
at java.logging/java.util.logging.LogManager$2.run(LogManager.java:401)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.logging/java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:382)
at java.logging/java.util.logging.LogManager.getLogManager(LogManager.java:436)
at java.logging/java.util.logging.Logger.demandLogger(Logger.java:648)
at java.logging/java.util.logging.Logger.getLogger(Logger.java:717)
at java.logging/java.util.logging.Logger.getLogger(Logger.java:701)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:68)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:188)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
See above.
REPRODUCIBILITY :
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
None found.
- backported by
-
JDK-8202819 Exception printed on console with custom LogManager on starting Apache Tomcat
- Resolved
-
JDK-8204114 Exception printed on console with custom LogManager on starting Apache Tomcat
- Resolved
-
JDK-8204111 Exception printed on console with custom LogManager on starting Apache Tomcat
- Closed
- duplicates
-
JDK-8198954 Tomcat server is not running with java 10.0.1
- Closed
- relates to
-
JDK-8191033 Regression in logging.properties: specifying .handlers= for root logger (instead of handlers=) no longer works
- Closed