[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×tamp=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×tamp=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>