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

2021.0.1.0 搭配nacos 2.0.4报错

java.lang.NoSuchMethodError: com.alibaba.nacos.common.utils.StringUtils.isBlank(Ljava/lang/String;)Z at com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver.getUri(NacosConfigDataLocationResolver.java:176) at com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver.loadConfigDataResources(NacosConfigDataLocationResolver.java:158) at com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver.resolveProfileSpecific(NacosConfigDataLocationResolver.java:151) at org.springframework.boot.context.config.ConfigDataLocationResolvers.lambda$resolve$2(ConfigDataLocationResolvers.java:120) at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:126) at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:119) at org.springframework.boot.context.config.ConfigDataLocationResolvers.resolve(ConfigDataLocationResolvers.java:107) at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:105) at org.springframework.boot.context.config.ConfigDataImporter.resolve(ConfigDataImporter.java:97) at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:85) at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:116) at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:311) at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:232) at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:102) at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:94) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.base/java.util.ArrayList.forEach(ArrayList.java:1378) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338) at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) at cn.com.xuct.calendar.gateway.GatewayApplication.main(GatewayApplication.java:32)

原提问者GitHub用户jianhao2010303

展开
收起
白夜行fighting 2023-06-11 09:53:56 644 0
1 条回答
写回答
取消 提交回答
  • 是有这个问题

    com.alibaba.nacos nacos-client 2.0.4 com.alibaba.cloud spring-cloud-starter-alibaba-nacos-config com.alibaba.nacos nacos-client

    应用程序无法启动 说明:试图调用一个不存在的方法。尝试是从以下位置进行的: com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver.getUri(NacosConfigDataLocationResolver.java:176)

    以下方法不存在: com.alibaba.nacos.common.utils.StringUtils.isBlank(Ljava/lang/String;)Z 调用方法的类com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver是从

    以下位置加载的: jar:file:/home/workoss/.m2/repository/com/alibaba/cloud/spring-cloud-starter-alibaba-nacos-config/2021.0.1.0/spring-cloud-starter-alibaba-nacos-config-2021.0.1.0.jar!/com/alibaba/cloud/nacos/configdata/NacosConfigDataLocationResolver.class

    被调用方法的类com.alibaba.nacos.commun.utils.StringUtils可从以下位置获得:

    jar:file:/home/workoss/.m2/repository/com/alibaba/nacos/nacos-client/2.0.4/nacos-client-2.0.4.jar!/com/alibaba/nacos/common/utils/StringUtils.class

    被调用方法的类层次结构是从以下位置加载的: com.alibaba.nacos.common.utils.StringUtils: file:/home/*/.m2/repository/com/alibaba/nacos/nacos-client/2.0.4/nacos-client-2.0.4.jar

    行动:

    更正应用程序的类路径,使其包含类com.alibaba.cloud.nacos.configdata.NacosConfigDataLocationResolver和com.alibabb.naco.common.utils.StringUtils的兼容版本

    原回答者GitHub用户ossworker

    2023-06-11 11:11:26
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:

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

相关电子书

更多
Nacos架构&原理 立即下载
workshop专场-微服务专场-开发者动手实践营-微服务-使用Nacos进行服务的动态发现和流量调度 立即下载
Nacos 启航,发布第一个版本, 云原生时代助力用户微服务平台建设 立即下载