ClassNotFoundException: org.I0Itec.zkclient.exception.ZkNoNodeException

本文将解决Dubbo启动抛出的“ClassNotFoundException: org.I0Itec.zkclient.exception.ZkNoNodeException”错误信息。

[21/03/19 10:20:22:022 CST] main  INFO transport.AbstractServer:  [DUBBO] Start NettyServer bind /0.0.0.0:20880, export /192.168.238.1:20880, dubbo version: 2.5.3, current host: 127.0.0.1

Exception in thread "main" java.lang.NoClassDefFoundError: org/I0Itec/zkclient/exception/ZkNoNodeException

at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37)

at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:94)

at com.alibaba.dubbo.registry.RegistryFactory$Adpative.getRegistry(RegistryFactory$Adpative.java)

at com.alibaba.dubbo.registry.integration.RegistryProtocol.getRegistry(RegistryProtocol.java:190)

at com.alibaba.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:109)

at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:53)

at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:54)

at com.alibaba.dubbo.rpc.Protocol$Adpative.export(Protocol$Adpative.java)

at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:485)

at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:281)

at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:242)

at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:143)

at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109)

at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)

at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:381)

at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:335)

at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:855)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)

at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)

at com.huangx.dubbo.provider.Provider.main(Provider.java:17)

Caused by: java.lang.ClassNotFoundException: org.I0Itec.zkclient.exception.ZkNoNodeException

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)

... 22 more

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO config.AbstractConfig:  [DUBBO] Run shutdown hook now., dubbo version: 2.5.3, current host: 127.0.0.1

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO support.AbstractRegistryFactory:  [DUBBO] Close all registries [], dubbo version: 2.5.3, current host: 127.0.0.1

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO dubbo.DubboProtocol:  [DUBBO] Close dubbo server: /192.168.238.1:20880, dubbo version: 2.5.3, current host: 127.0.0.1

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO transport.AbstractServer:  [DUBBO] Close NettyServer bind /0.0.0.0:20880, export /192.168.238.1:20880, dubbo version: 2.5.3, current host: 127.0.0.1

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO dubbo.DubboProtocol:  [DUBBO] Unexport service: dubbo://192.168.238.1:20880/com.huangx.dubbo.hello.HelloService?anyhost=true&application=demo-provider&dubbo=2.5.3&interface=com.huangx.dubbo.hello.HelloService&methods=sayHello&pid=12680&side=provider&timestamp=1553178022012, dubbo version: 2.5.3, current host: 127.0.0.1

[21/03/19 10:20:22:022 CST] DubboShutdownHook  INFO injvm.InjvmProtocol:  [DUBBO] Unexport service: injvm://127.0.0.1/com.huangx.dubbo.hello.HelloService?anyhost=true&application=demo-provider&dubbo=2.5.3&interface=com.huangx.dubbo.hello.HelloService&methods=sayHello&pid=12680&side=provider&timestamp=1553178022012, dubbo version: 2.5.3, current host: 127.0.0.1

Process finished with exit code 1

解决办法:

引入 zkclient 依赖 jar 文件,maven依赖如下:

<dependency>
    <groupId>com.github.sgroschupf</groupId>
    <artifactId>zkclient</artifactId>
    <version>0.1</version>
</dependency>
看书和学习是思想的经常营养,是思想的无穷发展。 —— 冈察洛夫
0 不喜欢
说说我的看法 -
全部评论(
没有评论
关于
本网站属于个人的非赢利性网站,转载的文章遵循原作者的版权声明,如果原文没有版权声明,请来信告知:hxstrive@outlook.com
公众号