Details
Description
Apache Accumulo is trying to switch to using log4j2 only. However, this seems impossible, because ZooKeeper has a hard-coded dependency on log4j 1.2 for some sort of jmx thing. The following is the error and stack trace I get whenever I remove log4j 1.2 from the class path and try to run a test instance of ZooKeeper as part of Accumulo's build test suite.
2020-02-24T20:10:03,682 [jmx.ManagedUtil] ERROR: Problems while registering log4j jmx beans! java.lang.ClassNotFoundException: org.apache.log4j.jmx.HierarchyDynamicMBean at jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581) ~[?:?] at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[?:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?] at java.lang.Class.forName0(Native Method) ~[?:?] at java.lang.Class.forName(Class.java:315) ~[?:?] at org.apache.zookeeper.jmx.ManagedUtil.registerLog4jMBeans(ManagedUtil.java:72) ~[zookeeper-3.5.7.jar:3.5.7] at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:94) ~[zookeeper-3.5.7.jar:3.5.7] at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64) ~[zookeeper-3.5.7.jar:3.5.7] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.apache.accumulo.start.Main.lambda$execMainClass$1(Main.java:167) ~[accumulo-start-2.1.0-SNAPSHOT.jar:2.1.0-SNAPSHOT] at java.lang.Thread.run(Thread.java:834) [?:?]
I know previous work has been done on ZOOKEEPER-850 and ZOOKEEPER-1371 to eliminate the use of log4j in the source, but this work does not appear to be complete, since it is still required at runtime (at least, for the server... but maybe for the client too... it's hard to tell from the way Accumulo runs its test suite, and I'm not super familiar with ZK internals).
Attachments
Issue Links
- is blocked by
-
ZOOKEEPER-2342 Migrate to Log4J 2.
- Resolved
- is related to
-
ZOOKEEPER-1371 Remove dependency on log4j in the source code.
- Closed
-
ZOOKEEPER-850 Switch from log4j to slf4j
- Resolved
- links to