zookeeper 启动ClassNotFoundException

Exception in thread "Thread-1" java.lang.
NoClassDefFoundError: org/apache/log4j/jmx/
HierarchyDynamicMBean

at org.apache.zookeeper.jmx.
ManagedUtil.
registerLog4jMBeans(
ManagedUtil.java:50)

at org.apache.zookeeper.server.
quorum.QuorumPeerMain.
runFromConfig(QuorumPeerMain.
java:122)

at com.complexible.stardog.pack.
cli.ZkStart$1.run(ZkStart.
java:119)

at java.lang.Thread.run(Unknown Source)

Caused by: java.lang.
ClassNotFoundException: org.apache.log4j.jmx.
HierarchyDynamicMBean

at java.net.URLClassLoader$1.run(
Unknown Source)

at java.net.URLClassLoader$1.run(
Unknown Source)

at java.security.
AccessController.doPrivileged(
Native Method)

at java.net.URLClassLoader.
findClass(Unknown Source)

at java.lang.ClassLoader.
loadClass(Unknown Source)

at sun.misc.Launcher$
AppClassLoader.loadClass(
Unknown Source)

at java.lang.ClassLoader.
loadClass(Unknown Source)

... 4 more

简单说吧,这个问题折腾我一下午,后来发现是jar包冲突

因为我之前在 $JAVA_HOME/jre/lib/ext/ 添加过一个log4j的jar包,这里运行zk就报错了,

那么把 $JAVA_HOME/jre/lib/ext/ 的log4j 删了就好了

时间: 2024-11-05 18:21:27

zookeeper 启动ClassNotFoundException的相关文章

zookeeper启动报错(数据目录权限不对)

zookeeper启动报错日志: 2016-11-16 11:19:43,880 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 3 (n.leader), 0x200111a88 (n.zxid), 0x1 (n.round), LOOKING (n.state), 3 (n.sid), 0x2 (n.peerEPoch), LOOKING (my state) 2016-11-16 11:1

zookeeper启动失败

集群中3个节点,第一个started,第二个说Starting zookeeper ... already running as process xxxx,第三个说Starting zookeeper ... already running as process yyyy. 原来是相应目录下残留的pid文件导致启动失败,打开那个文件一看里边的进程号正是提示出现的xxxx,yyyy.删除他们后重启,好了. zookeeper启动失败

zookeeper启动异常

zookeeper启动报异常 java.io.EOFException  at java.io.DataInputStream.readInt(DataInputStream.java:392) 遇到这个问题 第一步先删除 缓存文件 打开 conf 文件夹 找到 zoo.cfg 文件 找到缓存数据文件夹 p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo } span.s1 { } dataDir=/home349/vlan/zo

Zookeeper启动失败,报错 can not open chanel to 2

zookeeper 3.4.8 安装在 7 台不同的虚拟机上,配置文件如下: tickTime=2000 initLimit=10 syncLimit=5 dataDir=/var/zookeeper clientPort=2181 server.1=master1:2888:3888 server.2=master2:2888:3888 server.3=slave1:2888:3888 server.4=slave2:2888:3888 server.5=slave3:2888:3888 s

zookeeper启动入口

最近正在研究zookeeper,一些心得记录一下,如有错误,还请大神指正. zookeeper下载地址:http://zookeeper.apache.org/releases.html,百度一下就能找到,不过还是在这里列一下. 我认为学习一个东西,首先要理出一个头绪,否则感觉无从下手,这里我从启动开始研究,即从zkSever.sh入手. if [ "x$JMXDISABLE" = "x" ] then echo "JMX enabled by defau

zookeeper启动流程简单梳理

等着测试童鞋完工,顺便里了下zookeeper的启动流程 zk3.4.6 启动脚本里面 nohup "$JAVA" "-Dzookeeper.log.dir=${ZOO_LOG_DIR}" "-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \ -cp "$CLASSPATH" $JVMFLAGS $ZOOMAIN "$ZOOCFG" > "$_ZOO_D

ZooKeeper启动过程2:FastLeaderElection

前一篇文章中说到,启动ZooKeeper集群时,需要分别启动集群中的各个节点,各节点以QuorumPeer的形式启动,最后到达startLeaderElection和lookForLeader. 先说startLeaderElection 首先,初始化节点自身的currentVote[当前投票]为[myid.zxid.currentEpoch] 然后,初始化选举算法createElectionAlgorithm,默认使用FastLeaderElection算法,在这里,启动两个线程WorkerS

ZooKeeper启动过程

1.如何启动 zkServer.sh[Linux]或 zkServer.cmd[Windows] 以zkServer.cmd为例(zkServer.sh中内容太多): 可以清晰的看出:调用了QuorumPeerMain这个类,传的参数为%ZOOCFG%[在zkEnv.cmd中定义,就是zoo.cfg]. 到QuorumPeerMain类中一看,果然有个main方法,且接受一个参数[配置文件路径]: 当然,接受的参数不是一个也没关系,只不过就不能集群了,只能以单机模式运行.仅当接受一个参数作为配置

Zookeeper启动遇到的问题

[email protected]:/usr/zookeeper/bin# ./zkServer.sh start JMX enabled by default Using config: /usr/zookeeper/bin/../conf/zoo.cfg Starting zookeeper ... STARTED [email protected]:/usr/zookeeper/bin# ./zkServer.sh status JMX enabled by default Using c