NutzCN Logo
问答 zookeeper集群 dubbo 调用接口时报异常
发布于 109天前 作者 SiriusYJN 230 次浏览 复制 上一个帖子 下一个帖子
标签:

dubbo-client.xml 配置如下

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
       xsi:schemaLocation="http://www.springframework.org/schema/beans        http://www.springframework.org/schema/beans/spring-beans.xsd        http://code.alibabatech.com/schema/dubbo        http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <dubbo:application id="linshen-dubbo-consumer-id1" name="linshen-dubbo-consumer-name1"  />

    <dubbo:registry id="lin-registry-1" protocol="zookeeper" address="192.168.223.132:2181,192.168.223.133:2181,192.168.223.134:2181" />

    <dubbo:reference id="helloService" interface="com.linshen.dubbo.baseinterface.service.HelloService" />

</beans>

异常日志如下

org.nutz.ioc.IocException: IocBean[userStageDataService] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:116) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.66.jar:1.r.66]
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.66.jar:1.r.66]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.10]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.10]
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:387) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-all-1.4.1.jar:?]
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-all-1.4.1.jar:?]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.10]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.10]
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.1.9.jar:1.1.9]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.10]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.10]
	at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) [log4j-web-2.6.jar:2.6]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.10]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.10]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.10]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.10]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) [catalina.jar:9.0.10]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.10]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.10]
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) [catalina.jar:9.0.10]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:9.0.10]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.10]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.10]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.10]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) [tomcat-coyote.jar:9.0.10]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) [tomcat-coyote.jar:9.0.10]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.10]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_201]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_201]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.10]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Caused by: java.lang.RuntimeException: IocBean[userStageDataService] fail at field=[helloService]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:40) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[nutz-1.r.66.jar:1.r.66]
	... 52 more
Caused by: org.nutz.ioc.IocException: IocBean[helloService] throw Exception when creating
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[nutz-1.r.66.jar:1.r.66]
	... 52 more
Caused by: org.nutz.lang.InvokingException: Fail to invoke [org.nutz.integration.dubbo.ReferenceBean].get() by args:
 
For the reason: org/apache/zookeeper/KeeperException$NoNodeException
	at org.nutz.lang.Invoking.invoke(Invoking.java:195) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.lang.Mirror.invoke(Mirror.java:1132) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[nutz-1.r.66.jar:1.r.66]
	... 52 more
Caused by: java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException$NoNodeException
	at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.connect(CuratorZookeeperTransporter.java:26) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive.connect(ZookeeperTransporter$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.<init>(ZookeeperRegistry.java:69) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:95) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:269) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:63) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:98) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:63) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163) ~[dubbo-2.6.1.jar:2.6.1]
	at org.nutz.integration.dubbo.ReferenceBean.get(ReferenceBean.java:152) ~[nutz-integration-dubbo-1.r.66.jar:1.r.66]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
	at org.nutz.lang.Invoking$NullArgInvoker.invoke(Invoking.java:77) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.lang.Invoking.invoke(Invoking.java:192) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.lang.Mirror.invoke(Mirror.java:1132) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[nutz-1.r.66.jar:1.r.66]
	... 52 more
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.KeeperException$NoNodeException
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309) ~[catalina.jar:9.0.10]
	at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1138) ~[catalina.jar:9.0.10]
	at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.connect(CuratorZookeeperTransporter.java:26) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive.connect(ZookeeperTransporter$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.<init>(ZookeeperRegistry.java:69) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:95) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:269) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:63) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:98) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:63) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333) ~[dubbo-2.6.1.jar:2.6.1]
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163) ~[dubbo-2.6.1.jar:2.6.1]
	at org.nutz.integration.dubbo.ReferenceBean.get(ReferenceBean.java:152) ~[nutz-integration-dubbo-1.r.66.jar:1.r.66]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
	at org.nutz.lang.Invoking$NullArgInvoker.invoke(Invoking.java:77) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.lang.Invoking.invoke(Invoking.java:192) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.lang.Mirror.invoke(Mirror.java:1132) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.val.ReferTypeValue.get(ReferTypeValue.java:60) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.FieldInjector.inject(FieldInjector.java:32) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.weaver.DefaultWeaver.fill(DefaultWeaver.java:67) ~[nutz-1.r.66.jar:1.r.66]
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:138) ~[nutz-1.r.66.jar:1.r.66]
	... 52 more
9 回复

nutz dubbo 要指定两个地方的端口
参考这个下面的配置吧
https://github.com/TomYule/NutzSite-Dubbo

之前 我遇到的问题 指定端口 哪个帖子 忘了
jetty.port=0
server.port=0
server.host=0.0.0.0
类似

这个
jetty.port=0
server.port=0
server.host=0.0.0.0
是要写到 dubbo-client.xml 中嘛?

application.properties里面

nutz + nutz-integration-dubbo,不是nutzSite,然后配置文件是dubbo-client.xml,所以上面三个参数是在ioc里面去配置嘛?

@Test
	public void test_simple_hi() throws Exception {
		// 获取引用
		IHelloService way = ioc.get(IHelloService.class, "iHelloService");

		// 执行调用
		String resp = way.sayHello("wendal");
		assertEquals(resp, "hi,wendal");
	}

	// 模拟ioc环境. 真实环境下通过@IocBy即可,千万别自行new NutIoc

	Ioc ioc;

	@Before
	public void before() throws ClassNotFoundException {
		// 载入配置, 真实环境下会直接注入需要的对象
		ComboIocLoader loader = new ComboIocLoader("*dubbo", "dubbo-client.xml");
		ioc = new NutIoc(loader);
	}

	@After
	public void after() {
		if (ioc != null)
			ioc.depose();
	}

按照nutz-integration-dubbo 的测试,出现一下报错,@兽总,能否看下是需要怎么解决

org.nutz.ioc.IocException: IocBean[iHelloService] throw Exception when creating

	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:152)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:241)
	at org.nutz.ioc.impl.NutIoc.get(NutIoc.java:271)
	at tf.pmp.ChameleonTest.test_simple_hi(ChameleonTest.java:46)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Caused by: org.nutz.lang.InvokingException: Fail to invoke [org.nutz.integration.dubbo.ReferenceBean].get() by args:
 
For the reason: org/apache/zookeeper/KeeperException$NoNodeException
	at org.nutz.lang.Invoking.invoke(Invoking.java:195)
	at org.nutz.lang.Mirror.invoke(Mirror.java:1132)
	at org.nutz.ioc.impl.ObjectMakerImpl$1.born(ObjectMakerImpl.java:80)
	at org.nutz.ioc.weaver.DefaultWeaver.born(DefaultWeaver.java:78)
	at org.nutz.ioc.impl.ObjectMakerImpl.make(ObjectMakerImpl.java:117)
	... 27 more
Caused by: java.lang.NoClassDefFoundError: org/apache/zookeeper/KeeperException$NoNodeException
	at com.alibaba.dubbo.remoting.zookeeper.curator.CuratorZookeeperTransporter.connect(CuratorZookeeperTransporter.java:26)
	at com.alibaba.dubbo.remoting.zookeeper.ZookeeperTransporter$Adaptive.connect(ZookeeperTransporter$Adaptive.java)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry.<init>(ZookeeperRegistry.java:69)
	at com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistryFactory.createRegistry(ZookeeperRegistryFactory.java:37)
	at com.alibaba.dubbo.registry.support.AbstractRegistryFactory.getRegistry(AbstractRegistryFactory.java:95)
	at com.alibaba.dubbo.registry.RegistryFactory$Adaptive.getRegistry(RegistryFactory$Adaptive.java)
	at com.alibaba.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:269)
	at com.alibaba.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:98)
	at com.alibaba.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:63)
	at com.alibaba.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:63)
	at com.alibaba.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:394)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:333)
	at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:163)
	at org.nutz.integration.dubbo.ReferenceBean.get(ReferenceBean.java:152)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.nutz.lang.Invoking$NullArgInvoker.invoke(Invoking.java:77)
	at org.nutz.lang.Invoking.invoke(Invoking.java:192)
	... 31 more
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.KeeperException$NoNodeException
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 52 more

zk的jar版本问题

zk的版本是指 服务器上zk的版本 ,还是只nutz-dubbo的中zk的版本?但nutz-dubbo插件的pom文件我看了,是把zk的jar排除掉了

<dependency>
			<groupId>com.alibaba</groupId>
			<artifactId>dubbo</artifactId>
			<version>2.6.5</version>
			<exclusions>
				<exclusion>
					<groupId>org.springframework</groupId>
					<artifactId>spring</artifactId>
				</exclusion>
			</exclusions>
		</dependency>
		<dependency>
			<groupId>org.apache.curator</groupId>
			<artifactId>curator-framework</artifactId>
			<version>4.0.1</version>
			<exclusions>
				<exclusion>
					<groupId>org.apache.zookeeper</groupId>
					<artifactId>zookeeper</artifactId>
				</exclusion>
			</exclusions>
		</dependency>

声明个能用的版本就行

添加回复
请先登陆
回到顶部