• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

运行nacos时报错namingService unsubscribe failed

武飞扬头像
or?
帮助1

java.lang.RuntimeException: ErrCode:-400, ErrMsg:Could not initialize class com.alibaba.nacos.common.remote.client.grpc.GrpcSdkClient

at com.alibaba.cloud.nacos.NacosServiceManager.createNewNamingService(NacosServiceManager.java:102)

at com.alibaba.cloud.nacos.NacosServiceManager.buildNamingService(NacosServiceManager.java:90)

at com.alibaba.cloud.nacos.NacosServiceManager.getNamingService(NacosServiceManager.java:46)

at com.alibaba.cloud.nacos.discovery.NacosWatch.stop(NacosWatch.java:173)

at com.alibaba.cloud.nacos.discovery.NacosWatch.destroy(NacosWatch.java:204)

at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:213)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:587)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:559)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:1163)

at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:520)

at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:1156)

at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1106)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:596)

at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:147)

at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731)

at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303)

at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292)

at com.atguigu.gulimall.coupon.GulimallCouponApplication.main(GulimallCouponApplication.java:12)

Caused by: com.alibaba.nacos.api.exception.NacosException: java.lang.reflect.InvocationTargetException

at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:61)

at com.alibaba.nacos.api.NacosFactory.createNamingService(NacosFactory.java:77)

at com.alibaba.cloud.nacos.NacosServiceManager.createNewNamingService(NacosServiceManager.java:99)

... 19 common frames omitted

Caused by: java.lang.reflect.InvocationTargetException: null

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:423)

at com.alibaba.nacos.api.naming.NamingFactory.createNamingService(NamingFactory.java:59)

... 21 common frames omitted

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.nacos.common.remote.client.grpc.GrpcSdkClient

at com.alibaba.nacos.common.remote.client.RpcClientFactory.lambda$createClient$0(RpcClientFactory.java:81)

at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)

at com.alibaba.nacos.common.remote.client.RpcClientFactory.createClient(RpcClientFactory.java:79)

at com.alibaba.nacos.client.naming.remote.gprc.NamingGrpcClientProxy.<init>(NamingGrpcClientProxy.java:87)

at com.alibaba.nacos.client.naming.remote.NamingClientProxyDelegate.<init>(NamingClientProxyDelegate.java:76)

at com.alibaba.nacos.client.naming.NacosNamingService.init(NacosNamingService.java:95)

at com.alibaba.nacos.client.naming.NacosNamingService.<init>(NacosNamingService.java:81)

... 26 common frames omitted

最终在依赖中添加

<dependency>

<groupId>com.alibaba.nacos</groupId>

<artifactId>nacos-client</artifactId>

<version>2.0.4</version>

</dependency>

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgbhbaa
系列文章
更多 icon
同类精品
更多 icon
继续加载