You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "mercyblitz (GitHub)" <gi...@apache.org> on 2019/01/10 01:01:09 UTC

[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz opened issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

参照中文版本的代码结构。
新建了两个Springboot工程,一个是服务者,一个是消费者,服务者正常启动,消费者在controller使用@Reference无法注入服务者的服务接口方法。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 请附上您的代码
消费者:https://github.com/yexueyouling/service-dobbo-custom.git
服务者:https://github.com/yexueyouling/service-dobbo-server.git
这两个服务单独启动。


[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 消费者要依赖服务提供者的接口呀。。。不然怎么调用,我觉得你最好先去了解下dubbo

关键问题是现在依赖不上啊,我不明白的是为啥依赖不上。而且现在直接启动直接报错。
我现在做的是直连,并没有使用注册中心。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
你如果是在一台机器起这两个服务,dubbo端口不能设置一样。
不同机器起这两个服务,你消费者那边就不能填localhost。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 额。。。那你在pom里把依赖加上不就好了?
> 如果不知道怎么加,那最好先去了解下maven。
> 
> 我觉得你是不是理解错了,dubbo调用也是需要有接口依赖的,不然编译都过不了呀

我认为,直连的话,是不需要在pom加上服务者的依赖的,如果要这么加的话,dubbo直连和我平时用的方式没啥区别呀。我项目中跨服务调用都是在pom中加依赖的。类似这样:

<dependency>
	   		<groupId>com.framework</groupId>
	   		<artifactId>service-commons</artifactId>
	   		<version>2.0.0-SNAPSHOT</version>
	   </dependency>

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 额。。。那你在pom里把依赖加上不就好了?
> 如果不知道怎么加,那最好先去了解下maven。
> 
> 我觉得你是不是理解错了,dubbo调用也是需要有接口依赖的,不然编译都过不了呀

我认为,直连的话,是不需要在pom加上服务者的依赖的,如果要这么加的话,dubbo直连和我平时用的方式没啥区别呀。我项目中跨服务调用都是在pom中加依赖的。类似这样:

              <dependency>
	   		<groupId>com.framework</groupId>
	   		<artifactId>service-commons</artifactId>
	   		<version>2.0.0-SNAPSHOT</version>
	   </dependency>

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
看了下你custom的代码,没看到有依赖提供者的包,肯定是编译都过不去的。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
额。。。那你在pom里把依赖加上不就好了?
如果不知道怎么加,那最好先去了解下maven。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
消费者要依赖服务提供者的接口呀。。。不然怎么调用,我觉得你最好先去了解下dubbo

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 你如果是在一台机器起这两个服务,多宝端口不能设置一样。
> 不同机器起这两个服务,你消费者那边就不能填本地主机。



> 你如果是在一台机器起这两个服务,dubbo端口不能设置一样。
> 不同机器起这两个服务,你消费者那边就不能填localhost。

你说的对,但是我现在遇到的问题是,在消费端注入服务端服务的时候,完全引用不到啊。直接就报错了。
![image](https://user-images.githubusercontent.com/26735625/50951683-0e380a80-14e9-11e9-8097-a2166e9a210e.png)


[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
赶紧做出这个功能给这个项目提个PR,我看好你。。。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling closed issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
[ issue closed by yexueyouling ]

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 看了下你custom的代码,没看到有依赖提供者的包,肯定是编译都过不去的。

是的,没有依赖包肯定是编译出错的。所以我想知道我是不是少配了什么东西,导致无法导入服务者的包。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
。。。这个是IDE的问题,你试试直接启动看看。。小哥难道没用过mybatis?注入mapper一样会报这个错。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 额。。。那你在pom里把依赖加上不就好了?
> 如果不知道怎么加,那最好先去了解下maven。
> 
> 我觉得你是不是理解错了,dubbo调用也是需要有接口依赖的,不然编译都过不了呀

我认为,直连的话,是不需要在pom加上服务者的依赖的,如果要这么加的话,dubbo直连和我平时用的方式没啥区别呀。我项目中跨服务调用都是在pom中加依赖的。类似这样:

    <dependency>
	   		<groupId>com.framework</groupId>
	   		<artifactId>service-commons</artifactId>
	   		<version>2.0.0-SNAPSHOT</version>
	   </dependency>

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] cwdtom commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "cwdtom (GitHub)" <gi...@apache.org>.
额。。。那你在pom里把依赖加上不就好了?
如果不知道怎么加,那最好先去了解下maven。

我觉得你是不是理解错了,dubbo调用也是需要有接口依赖的,不然编译都过不了呀

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
Please attach your code

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
消费者:https://github.com/yexueyouling/service-dobbo-custom.git
服务者:https://github.com/yexueyouling/service-dobbo-server.git
这两个服务单独启动。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 赶紧做出这个功能给这个项目提个PR,我看好你。。。

兄弟,别闹了,我怕我们PM直接就给我安排了,今年过完年就不用回来了,哈哈哈。
另外,我决定听从你的意见。pom加入服务者的依赖。毕竟直连用的好像挺少的,我记着去研究注册中心了。谢谢。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
@cwdtom 记得往我结贴。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] mercyblitz closed issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "mercyblitz (GitHub)" <gi...@apache.org>.
[ issue closed by mercyblitz ]

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 你如果是在一台机器起这两个服务,dubbo端口不能设置一样。
> 不同机器起这两个服务,你消费者那边就不能填localhost。

你说的对,但是我现在遇到的问题是,在消费端注入服务端服务的时候,完全引用不到啊。直接就报错了。
![image](https://user-images.githubusercontent.com/26735625/50951683-0e380a80-14e9-11e9-8097-a2166e9a210e.png)


[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling closed issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
[ issue closed by yexueyouling ]

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org


[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling commented on issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
> 消费者要依赖服务提供者的接口呀。。。不然怎么调用,我觉得你最好先去了解下dubbo

关键问题是现在依赖不上啊,我不明白的是为啥依赖不上。而且现在直接启动直接报错。

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org

[GitHub] [incubator-dubbo-spring-boot-project] yexueyouling closed issue #379: 只配置了服务者和消费者,服务者启动后,消费者无法引用到服务者下的方法

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
[ issue closed by yexueyouling ]

[ Full content available at: https://github.com/apache/incubator-dubbo-spring-boot-project/issues/379 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org