duoan / mini-rpc

Spring + Netty + Protostuff + ZooKeeper 实现了一个轻量级 RPC 框架,使用 Spring 提供依赖注入与参数配置,使用 Netty 实现 NIO 方式的数据传输,使用 Protostuff 实现对象序列化,使用 ZooKeeper 实现服务注册与发现。使用该框架,可将服务部署到分布式环境中的任意节点上,客户端通过远程接口来调用服务端的具体实现,让服务端与客户端的开发完全分离,为实现大规模分布式应用提供了基础支持
226 stars 143 forks source link

请问下例子中zookeeper创建节点报了个错是什么原因,百度了下没用找到合适的解决方法 #2

Open liaohanjie opened 6 years ago

liaohanjie commented 6 years ago

org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /registry/data at org.apache.zookeeper.KeeperException.create(KeeperException.java:114) at org.apache.zookeeper.KeeperException.create(KeeperException.java:54) at org.apache.zookeeper.ZooKeeper.create(ZooKeeper.java:786) at me.anduo.rpc.server.core.ServiceRegistry.createNode(ServiceRegistry.java:74) at me.anduo.rpc.server.core.ServiceRegistry.register(ServiceRegistry.java:44) at me.anduo.rpc.server.core.RpcServer.afterPropertiesSet(RpcServer.java:94) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1511) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:191) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:636) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:934) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83) at me.anduo.rpc.server.core.RpcBootstrap.main(RpcBootstrap.java:12)

SilenRY commented 3 years ago

兄弟,你的这个问题解决了吗,我也遇到了

superxp commented 3 years ago

兄弟,你们必须先自己去ZK创建REGISTER 目录 @liaohanjie @SilenRY

zealrussell commented 2 years ago

兄弟,你们必须先自己去ZK创建REGISTER 目录 @liaohanjie @SilenRY

兄弟,你最终运行成功了吗

cmgyqjj commented 1 year ago

在RpcHandler中response默认返回error=null,但是在RpcProxy中,使用response.isError()来判断异常会导致正常执行也出错,不知道你是不是因为这个原因没有运行成功 @zealrussell