Caused by: java.lang.NoClassDefFoundError: org/apache/curator/framework/api/CuratorWatcher

Caused by: java.lang.NoClassDefFoundError: org/apache/curator/framework/api/CuratorWatcher

D:\software\java\jdk1.8.0_281\bin\java.exe "-javaagent:D:\software\IntelliJ IDEA 2019.1.4\lib\idea_rt.jar=60729:D:\software\IntelliJ IDEA 2019.1.4\bin" -Dfile.encoding=UTF-8 -classpath D:\software\java\jdk1.8.0_281\jre\lib\charsets.jar;D:\software\java\jdk1.8.0_281\jre\lib\deploy.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\access-bridge-64.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\cldrdata.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\dnsns.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\jaccess.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\jfxrt.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\localedata.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\nashorn.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\sunec.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\sunjce_provider.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\sunmscapi.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\sunpkcs11.jar;D:\software\java\jdk1.8.0_281\jre\lib\ext\zipfs.jar;D:\software\java\jdk1.8.0_281\jre\lib\javaws.jar;D:\software\java\jdk1.8.0_281\jre\lib\jce.jar;D:\software\java\jdk1.8.0_281\jre\lib\jfr.jar;D:\software\java\jdk1.8.0_281\jre\lib\jfxswt.jar;D:\software\java\jdk1.8.0_281\jre\lib\jsse.jar;D:\software\java\jdk1.8.0_281\jre\lib\management-agent.jar;D:\software\java\jdk1.8.0_281\jre\lib\plugin.jar;D:\software\java\jdk1.8.0_281\jre\lib\resources.jar;D:\software\java\jdk1.8.0_281\jre\lib\rt.jar;E:\My\IDEA-workspace\DubboConsumerTest\target\classes;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-context\5.3.5\spring-context-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-aop\5.3.5\spring-aop-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-beans\5.3.5\spring-beans-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-core\5.3.5\spring-core-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-jcl\5.3.5\spring-jcl-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\org\springframework\spring-expression\5.3.5\spring-expression-5.3.5.jar;D:\software\maven-3.6.0\MavenRepository\com\ufgov\dp\si\com_ufgov_toNeusoft\1.0\com_ufgov_toNeusoft-1.0.jar;D:\software\maven-3.6.0\MavenRepository\com\ufgov\dp\si\dubbo\2.8.5.7\dubbo-2.8.5.7.jar;D:\software\maven-3.6.0\MavenRepository\javassist\javassist\3.12.1.GA\javassist-3.12.1.GA.jar;D:\software\maven-3.6.0\MavenRepository\io\netty\netty\3.7.0.Final\netty-3.7.0.Final.jar;D:\software\maven-3.6.0\MavenRepository\org\apache\zookeeper\zookeeper\3.4.6\zookeeper-3.4.6.jar;D:\software\maven-3.6.0\MavenRepository\org\slf4j\slf4j-api\1.6.1\slf4j-api-1.6.1.jar;D:\software\maven-3.6.0\MavenRepository\log4j\log4j\1.2.16\log4j-1.2.16.jar;D:\software\maven-3.6.0\MavenRepository\jline\jline\0.9.94\jline-0.9.94.jar;D:\software\maven-3.6.0\MavenRepository\junit\junit\3.8.1\junit-3.8.1.jar com.mywork.consumer.MyConsumer
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
log4j:WARN No appenders could be found for logger (com.alibaba.dubbo.common.logger.LoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
consumer start
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'offsiteTransferService': FactoryBean threw exception on object creation; nested exception is java.lang.NoClassDefFoundError: org/apache/curator/framework/api/CuratorWatcher
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:176)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:101)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1884)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getObjectForBeanInstance(AbstractAutowireCapableBeanFactory.java:1266)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:267)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1273)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1234)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:494)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:349)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:342)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1172)
	at com.mywork.consumer.MyConsumer.main(MyConsumer.java:13)
Caused by: java.lang.NoClassDefFoundError: org/apache/curator/framework/api/CuratorWatcher
	at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.connect(CuratorZookeeperTransporter.java:10)
	at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adpative.connect(ZookeeperTransporter$Adpative.java)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.<init>(ZookeeperRegistry.java:70)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37)
	at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:104)
	at com.alibaba.dubbo.registry.RegistryFactory$Adpative.getRegistry(RegistryFactory$Adpative.java)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:242)
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:63)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:60)
	at com.alibaba.dubbo.rpc.Protocol$Adpative.refer(Protocol$Adpative.java)
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:406)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:303)
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:139)
	at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:169)
	... 12 more
Caused by: java.lang.ClassNotFoundException: org.apache.curator.framework.api.CuratorWatcher
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 27 more
Exception in thread "DubboShutdownHook" java.lang.ExceptionInInitializerError
	at com.alibaba.dubbo.config.ProtocolConfig.destroyAll(ProtocolConfig.java:486)
	at com.alibaba.dubbo.config.AbstractConfig$1.run(AbstractConfig.java:452)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Shutdown in progress
	at java.lang.ApplicationShutdownHooks.add(ApplicationShutdownHooks.java:66)
	at java.lang.Runtime.addShutdownHook(Runtime.java:211)
	at com.alibaba.dubbo.remoting.transport.netty.NettyClient.<clinit>(NettyClient.java:58)
	... 3 more

Process finished with exit code 1

解决

在maven中引入依赖:

   <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-framework</artifactId>
            <version>4.0.1</version>
        </dependency>

        <dependency>
            <groupId>org.apache.curator</groupId>
            <artifactId>curator-recipes</artifactId>
            <version>4.0.1</version>
        </dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值