开发者社区 > 云原生 > 正文

当我想使用dubbo.application.service-discovery.migration

org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration

org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration

org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration

org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration

org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration

14:26:46.189 ERROR [main] o.springframework.boot.SpringApplication:837 - Application run failed java.lang.NullPointerException: null at org.apache.dubbo.metadata.MetadataInfo.init(MetadataInfo.java:122) at org.apache.dubbo.registry.client.AbstractServiceDiscovery.getRemoteMetadata(AbstractServiceDiscovery.java:164) at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.doOnEvent(ServiceInstancesChangedListener.java:155) at org.apache.dubbo.registry.client.event.listener.ServiceInstancesChangedListener.onEvent(ServiceInstancesChangedListener.java:113) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribeURLs(ServiceDiscoveryRegistry.java:312) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.doSubscribe(ServiceDiscoveryRegistry.java:216) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistry.subscribe(ServiceDiscoveryRegistry.java:184) at org.apache.dubbo.registry.ListenerRegistryWrapper.subscribe(ListenerRegistryWrapper.java:111) at org.apache.dubbo.registry.integration.DynamicDirectory.subscribe(DynamicDirectory.java:180) at org.apache.dubbo.registry.client.ServiceDiscoveryRegistryDirectory.subscribe(ServiceDiscoveryRegistryDirectory.java:107) at org.apache.dubbo.registry.integration.RegistryProtocol.doCreateInvoker(RegistryProtocol.java:569) at org.apache.dubbo.registry.integration.InterfaceCompatibleRegistryProtocol.getServiceDiscoveryInvoker(InterfaceCompatibleRegistryProtocol.java:65) at org.apache.dubbo.registry.client.migration.MigrationInvoker.refreshServiceDiscoveryInvoker(MigrationInvoker.java:428) at org.apache.dubbo.registry.client.migration.MigrationInvoker.migrateToApplicationFirstInvoker(MigrationInvoker.java:244) at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.refreshInvoker(MigrationRuleHandler.java:73) at org.apache.dubbo.registry.client.migration.MigrationRuleHandler.doMigrate(MigrationRuleHandler.java:57) at org.apache.dubbo.registry.client.migration.MigrationRuleListener.onRefer(MigrationRuleListener.java:241) at org.apache.dubbo.registry.integration.RegistryProtocol.interceptInvoker(RegistryProtocol.java:534) at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:504) at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:486) at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:74) at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:83) at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:71) at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.refer(ProtocolSerializationWrapper.java:52) at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java) at org.apache.dubbo.config.ReferenceConfig.createInvokerForRemote(ReferenceConfig.java:493) at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:396) at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:279) at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:219) at org.apache.dubbo.config.utils.SimpleReferenceCache.get(SimpleReferenceCache.java:110) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.lambda$referServices$6(DefaultModuleDeployer.java:384) at java.util.concurrent.ConcurrentHashMap$ValuesView.forEach(ConcurrentHashMap.java:4707) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.referServices(DefaultModuleDeployer.java:364) at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:151) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:111) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:100) at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:45) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at com.clife.family.sports.api.web.ClifeFamilySportsApiWebApplication.main(ClifeFamilySportsApiWebApplication.java:22)

但是,当我把订阅指向为接口唯一FORCE_INTERFACE时,程序能够正常运行并完成预想效果。 这是为什么呢?是应用级还需要其他什么配置嘛?

原提问者GitHub用户Jimy-Guo

展开
收起
大圣东游 2023-05-11 19:07:58 134 0
1 条回答
写回答
取消 提交回答
  • 默认情况下,不做特殊配置,就是双注册和双订阅。从日志看已经走双订阅的逻辑了,接口级别订阅已经成功了,应用级别发生了空指针,不过空指针触发的位置有点奇怪,你可以再检查一下,或者可以贴一下你的示例代码和配置信息,我试下能否复现

    原回答者GitHub用户BurningCN

    2023-05-12 10:56:33
    赞同 展开评论 打赏
问答地址:

阿里云拥有国内全面的云原生产品技术以及大规模的云原生应用实践,通过全面容器化、核心技术互联网化、应用 Serverless 化三大范式,助力制造业企业高效上云,实现系统稳定、应用敏捷智能。拥抱云原生,让创新无处不在。

热门讨论

热门文章

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载