Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-3737

Unable to eliminate log4j1 transitive dependency

    XMLWordPrintableJSON

Details

    • Reviewed

    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

          Activity

            People

              ctubbsii Christopher Tubbs
              ctubbsii Christopher Tubbs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 20m
                  1h 20m