question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

zookeeper 3.4.6 unable to start by replacing reload4j jar directly into binary.

See original GitHub issue

Our customer has concerns about the log4j vulnerabilities, we ran an activity and replaced all the log4j occurrences with the reload4j and those are working fine. But unfortunately we’ve some components like ( elastic-search/zookeeper/logstash ) and their binaries are using the log4j-1.2.16/17 rev. (zookeeper) and log4j-core-2.16.x/log4j-core-2.11.x (elastic-search/logstash). We successfully upgraded the elastic-search/logstash log4j version to log4j-core-2.17.1 ( by placing the higher version jars ) in lib directory but when we tried the same with zookeeper by replacing the log4j-1.2.16 with reload4j directly in lib and starts the zookeeper it throws the following exception:

tail: /var/seamless/log/zookeeper/init.out: file truncated Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/jmx/HierarchyDynamicMBean at org.apache.zookeeper.jmx.ManagedUtil.registerLog4jMBeans(ManagedUtil.java:50) at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:74) at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:52) at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116) at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78) Caused by: java.lang.ClassNotFoundException: org.apache.log4j.jmx.HierarchyDynamicMBean at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 5 more

reload4j doesn’t include the HierarchyDynamicMBean.class which causing this issue. Can someone please guide how we can fix this?

Thanks

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
123Haynescommented, Mar 9, 2022

@muneebamjad you can try setting the system property zookeeper.jmx.log4j.disable to true .
That way zookeeper won’t try to register those mbeans.

See here for the relevant docs: https://github.com/apache/zookeeper/blob/master/zookeeper-docs/src/main/resources/markdown/zookeeperJMX.md#log4j-mbeans-deprecated

0reactions
muneebamjadcommented, Mar 9, 2022

@123Haynes for the comment you added. I tried and it worked with the latest reload4j (1.2.19) . I’m closing this ticket with this comment. Thanks Haynes for your time and guiding us. Much appreciated

Read more comments on GitHub >

github_iconTop Results From Across the Web

1181487 – zookeeper service fails to start - Red Hat Bugzilla
Description of problem: zookeeper service fails to start. Version-Release number of selected component (if applicable): 3.4.6-2.fc21 How reproducible: ...
Read more >
Release Notes - ZooKeeper - Version 3.5.10
ZOOKEEPER -982 - zkServer.sh won't start zookeeper on an ubuntu 10.10 system due to a bug in the startup script. ZOOKEEPER-984 - jenkins...
Read more >
NoClassDefFoundError for zookeeper by replacing the log4j ...
For these we made the direct change in /lib/ directory and replaced the old jars with latests, this works fine for elastic-search/logstash ....
Read more >
CSCvm58786 - Known issue in Zookeeper 3.4.6 ... - Cisco Bug
Symptom: Zookeeper was in an endless restart cycle due to monit on the cluster manager: Process 'zookeeper-server' Initializing The logs ...
Read more >
Zookeeper fails to start when run as an ensemble ... - GitHub
I am trying to set up exhibitor (built from code as of last month) and zookeeper (3.4.6) ensemble (of 3) on EC2 and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found