开发环境测试没有问题,上测试环境报错,而且只有一个service报错
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'corCrmBankFlowAction': Unsatisfied dependency expressed through field 'corCrmRefundFlowService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corCrmRefundFlowService': FactoryBean threw exception on object creation; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to create remoting client for service(dubbo://127.0.0.1:20880/com.tone.service.CorCrmRefundFlowService?application=consumer-userService&codec=dubbo&default.timeout=30000&dubbo=2.5.3&heartbeat=60000&interface=com.tone.service.CorCrmRefundFlowService&methods=findBySqlId,removeById,save,getTotalCount,saveList,update,findPage,updates,findAll,updateBySqlId,removeByIds,saves,findPageBySqlId,findList,findById,removeByObject&pid=30005&side=consumer×tamp=1511858034278): client(url: dubbo://127.0.0.1:20880/com.tone.service.CorCrmRefundFlowService?application=consumer-userService&codec=dubbo&default.timeout=30000&dubbo=2.5.3&heartbeat=60000&interface=com.tone.service.CorCrmRefundFlowService&methods=findBySqlId,removeById,save,getTotalCount,saveList,update,findPage,updates,findAll,updateBySqlId,removeByIds,saves,findPageBySqlId,findList,findById,removeByObject&pid=30005&side=consumer×tamp=1511858034278) failed to connect to server /127.0.0.1:20880, error message is:Connection refused |
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corCrmRefundFlowService': FactoryBean threw exception on object creation; nested exception is com.alibaba.dubbo.rpc.RpcException: Fail to create remoting client for service(dubbo://127.0.0.1:20880/com.tone.service.CorCrmRefundFlowService?application=consumer-userService&codec=dubbo&default.timeout=30000&dubbo=2.5.3&heartbeat=60000&interface=com.tone.service.CorCrmRefundFlowService&methods=findBySqlId,removeById,save,getTotalCount,saveList,update,findPage,updates,findAll,updateBySqlId,removeByIds,saves,findPageBySqlId,findList,findById,removeByObject&pid=30005&side=consumer×tamp=1511858034278): client(url: dubbo://127.0.0.1:20880/com.tone.service.CorCrmRefundFlowService?application=consumer-userService&codec=dubbo&default.timeout=30000&dubbo=2.5.3&heartbeat=60000&interface=com.tone.service.CorCrmRefundFlowService&methods=findBySqlId,removeById,save,getTotalCount,saveList,update,findPage,updates,findAll,updateBySqlId,removeByIds,saves,findPageBySqlId,findList,findById,removeByObject&pid=30005&side=consumer×tamp=1511858034278) failed to connect to server /127.0.0.1:20880, error message is:Connection refused |
本以为是spring的配置问题,事实证明还是dubbo没配置好。
在开发环境中为了开发方便,用的本地直连,设置的local127.0.0.1访问。在上测试环境的时候改成了ZooKeeper的连接,因为用的是全局替换,这个service漏掉了,xml中依然是url="dubbo://127.0.0.1:20880"。导致报错。