sofastack / sofa-rpc

SOFARPC is a high-performance, high-extensibility, production-level Java RPC framework.
https://www.sofastack.tech/sofa-rpc/docs/Home
Apache License 2.0
3.83k stars 1.18k forks source link

Sofa-rpc configuration nacos, nacos web side does not display services #717

Closed 11508github closed 4 years ago

11508github commented 5 years ago

Describe the bug

A clear and concise description of what the bug is. sofa-rpc配置nacos,nacos的web端不显示服务

Expected behavior

nacos的web端可以显示服务

Actual behavior

nacos的web端不显示服务

Steps to reproduce

sofa-rpc配置nacos,service和client都可以正在工作,但是nacos的web端无法显示,nacos的版本v1.1.0,

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

sofastack-bot[bot] commented 5 years ago

Hi @11508github, we detect non-English characters in the issue. This comment is an auto translation by @sofastack-robot to help other users to understand this issue.

We encourage you to describe your issue in English which is more friendly to other users.

Describe the bug A clear and concise description of what the bug is.

sofa-rpc configuration nacos, nacos web side does not display service

Expected behavior

nacos web side can display service

Actual behavior

nacos web End does not display service

Steps to reproduce

sofa-rpc configuration nacos, service and client can work, but nacos web side can not be displayed, nacos version v1.1.0,

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

JervyShi commented 5 years ago

@11508github 请问你这边使用到的 sofa-rpc 版本是?有可复现 demo 么?

ghost commented 5 years ago

@11508github 请问你这边使用到的 sofa-rpc 版本是?有可复现 demo 么?

复现demo https://github.com/dodo4/lab.git

JervyShi commented 5 years ago

@dodo4 问题定位中,有结论同步给你

mail6562 commented 5 years ago

用最新版本都nacos,集成会提示参数为空

walter211 commented 5 years ago

how about this issue now

qq2357509207 commented 5 years ago

环境:sofa boot v3.2.0 + sofa rpc +nacos v1.0.0 + dubbo

问题:

"ReadinessCheckCallback": { "rpcAfterHealthCheckCallback": { "status": "DOWN", "details": { "error": "java.lang.RuntimeException: java.lang.NoSuchMethodError: com.alibaba.nacos.api.naming.pojo.ServiceInfo.getKey(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;" } } }

An attempt was made to call the method com.alibaba.nacos.api.naming.pojo.ServiceInfo.getKey(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String; but it does not exist.

khotyn commented 5 years ago

@qq2357509207 Hi,能够把完整的堆栈给贴出来吗?

qq2357509207 commented 5 years ago

@qq2357509207 Hi,能够把完整的堆栈给贴出来吗?

2019-10-11 20:04:46.171 WARN 14024 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jvmServiceConsumer' defined in file [C:\Users\yss\Desktop\libo_2019_7_11\IdeaProjects\sofademo\serviceconsumerdemo\target\classes\com\demo\sofa\JvmServiceConsumer.class]: Initialization of bean failed; nested exception is com.alipay.sofa.runtime.api.ServiceRuntimeException: Unable to get implementation of reference component, there's some error occurred when register this reference component. 2019-10-11 20:04:46.174 INFO 14024 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2019-10-11 20:04:46.191 INFO 14024 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2019-10-11 20:04:46.199 ERROR 14024 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

An attempt was made to call the method com.alibaba.nacos.api.naming.pojo.ServiceInfo.getKey(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String; but it does not exist. Its class, com.alibaba.nacos.api.naming.pojo.ServiceInfo, is available from the following locations:

jar:file:/C:/Users/yss/.m2/repository/com/alibaba/nacos/nacos-api/1.0.0/nacos-api-1.0.0.jar!/com/alibaba/nacos/api/naming/pojo/ServiceInfo.class

It was loaded from the following location:

file:/C:/Users/yss/.m2/repository/com/alibaba/nacos/nacos-api/1.0.0/nacos-api-1.0.0.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of com.alibaba.nacos.api.naming.pojo.ServiceInfo

khotyn commented 5 years ago

@qq2357509207 请问你们 Dubbo 用的是哪个版本?

qq2357509207 commented 5 years ago

@qq2357509207 请问你们 Dubbo 用的是哪个版本?

2.6.5

khotyn commented 4 years ago
image

我的依赖信息如上,但是没有能重现你的问题,能给一个最小能够重现的 Demo 吗? @qq2357509207

qq2357509207 commented 4 years ago

我的依赖信息如上 dubbo-registry-nacos 尝试过 0.0.1 、2.6.7、2.6.6 这三个版本  问题差不多 复现demo在附件中

------------------ 原始邮件 ------------------ 发件人: "Khotyn Huang"<notifications@github.com>; 发送时间: 2019年11月17日(星期天) 中午1:49 收件人: "sofastack/sofa-rpc"<sofa-rpc@noreply.github.com>; 抄送: "2357509207"<2357509207@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [sofastack/sofa-rpc] Sofa-rpc configuration nacos, nacos web side does not display services (#717)

我的依赖信息如上,但是没有能重现你的问题,能给一个最小能够重现的 Demo 吗? @qq2357509207
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

khotyn commented 4 years ago

@qq2357509207 你好,因为这个是直接回复给 Github 的,所以我没有看到邮件的附件,你能够把 Demo 发给 khotyn.huangt@antfin.com 这个邮箱吗?

khotyn commented 4 years ago

@qq2357509207 我看了一下你的错误,应该是整个 classpath 下面又有 nacos 1.1.1 的版本,又有 nacos 1.1.0 的版本,你能够看下依赖树,看下到底这两个版本到底是谁间接引入进来的吗?

khotyn commented 4 years ago

@qq2357509207 大概看了一下,一个版本是 SOFARPC 引入进来的,另一个版本是 dubbo-registry-nacos 2.6.7 引入进来的,你可以在最外层的 pom.xml 中加上如下的内容来把依赖的冲突给解决掉:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-client</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-api</artifactId>
                <version>1.1.1</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.nacos</groupId>
                <artifactId>nacos-common</artifactId>
                <version>1.1.1</version>
            </dependency>
        </dependencies>
    </dependencyManagement>
qq2357509207 commented 4 years ago

问题已解决,感谢!

------------------ 原始邮件 ------------------ 发件人: "Khotyn Huang"<notifications@github.com>; 发送时间: 2019年11月19日(星期二) 上午10:15 收件人: "sofastack/sofa-rpc"<sofa-rpc@noreply.github.com>; 抄送: "2357509207"<2357509207@qq.com>;"Mention"<mention@noreply.github.com>; 主题: Re: [sofastack/sofa-rpc] Sofa-rpc configuration nacos, nacos web side does not display services (#717)

@qq2357509207 大概看了一下,一个版本是 SOFARPC 引入进来的,另一个版本是 dubbo-registry-nacos 2.6.7 引入进来的,你可以在最外层的 pom.xml 中加上如下的内容来把依赖的冲突给解决掉: <dependencyManagement> <dependencies> <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-client</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-api</artifactId> <version>1.1.1</version> </dependency> <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-common</artifactId> <version>1.1.1</version> </dependency> </dependencies> </dependencyManagement>

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

khotyn commented 4 years ago

@qq2357509207 好的,后面有其他的问题可以新开 Issue 哈。