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

[GitHub] [incubator-dubbo] yexueyouling opened issue #3190: 注解配置无法启动

按照注解配置,使用Springboot,搭建了两个工程,一个消费者,一个服务者,并且创建了一个zookeeper容器。结构如下:
![image](https://user-images.githubusercontent.com/26735625/51016127-16a44a00-15aa-11e9-8360-2daac8012a1c.png)
服务者可以正常启动。
消费者启动失败,有两个错误问题
1、@Reference无法注入服务者的服务。
2、启动报错:Duplicate application configs: <dubbo:application name="service-dUbbo-custom" id="service-dUbbo-custom" /> and <dubbo:application qosEnable="false" />

完全不知道是什么原因。

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

[GitHub] [incubator-dubbo] kexianjun commented on issue #3190: 注解配置无法启动

Posted by "kexianjun (GitHub)" <gi...@apache.org>.
> @kexianjun 你说的对,我可以引入server的依赖,然后正常引用。但是我使用了zookeeper,我不希望将server引入到消费端,不然项目庞大了,每引用另一个工程,都要去加依赖,岂不是很难管理。

api的定义和实现分成不同的包,就像dubbo提供的demo一样,api作为公共的依赖

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

[GitHub] [incubator-dubbo] kexianjun commented on issue #3190: 注解配置无法启动

Posted by "kexianjun (GitHub)" <gi...@apache.org>.
你的消费端配置依赖

```
<dependency>
			<groupId>com.example</groupId>
			<artifactId>service-dobbo-server</artifactId>
			<version>0.0.1-SNAPSHOT</version>
    </dependency>
```
com.example.dubbo.service.IDemoServer 的实现在 com.example.dubbo.service package,然后又在controller 里面引用IDemoServer,你是想用调用jvm本地调用(injvm)服务吗?Demo可以参考https://github.com/apache/incubator-dubbo/tree/master/dubbo-demo 这里面的,基于xml配置启动的和基于注解的都有

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

[GitHub] [incubator-dubbo] yexueyouling closed issue #3190: 注解配置无法启动

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

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


[GitHub] [incubator-dubbo] yexueyouling commented on issue #3190: 注解配置无法启动

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
@gudegg 不可以去掉消费者的Application Bean,否则会引起下面的错误。
![image](https://user-images.githubusercontent.com/26735625/51152837-88c9a700-18a8-11e9-907c-d32eb91bd431.png)


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

[GitHub] [incubator-dubbo] yiyutao commented on issue #3190: 注解配置无法启动

Posted by "yiyutao (GitHub)" <gi...@apache.org>.
最近使用最新的springboot和dubbo-spring-boot-starter会报dubbo:application重复配置,我现在的解决办法是把xml中的dubbo:application删除,然后在application.yml单独配置dubbo:application

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

[GitHub] [incubator-dubbo] yexueyouling commented on issue #3190: 注解配置无法启动

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
@kexianjun 你的意思是,在服务者和消费者中间,加一个中间工程,所有的消费者都调用这个工程,所有的服务这都注入到这个中间工程对吗?



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

[GitHub] [incubator-dubbo] yexueyouling commented on issue #3190: 注解配置无法启动

Posted by "yexueyouling (GitHub)" <gi...@apache.org>.
@kexianjun 你说的对,我可以引入server的依赖,然后正常引用。但是我使用了zookeeper,我不希望将server引入到消费端,不然项目庞大了,每引用另一个工程,都要去加依赖,岂不是很难管理。

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

[GitHub] [incubator-dubbo] gudegg commented on issue #3190: 注解配置无法启动

Posted by "gudegg (GitHub)" <gi...@apache.org>.
ApplicationConfig重复配置了,你把消费者的`ApplicationConfig`Bean配置移除掉再试下

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

[GitHub] [incubator-dubbo] kexianjun commented on issue #3190: 注解配置无法启动

Posted by "kexianjun (GitHub)" <gi...@apache.org>.
你的消费端配置依赖

```
<dependency>
			<groupId>com.example</groupId>
			<artifactId>service-dobbo-server</artifactId>
			<version>0.0.1-SNAPSHOT</version>
    </dependency>
```
com.example.dubbo.service.IDemoServer 的实现在 com.example.dubbo.service package,然后又在controller 里面引用IDemoServer,你是想用调用jvm本地调用(injvm)服务吗?Demo可以参考https://github.com/apache/incubator-dubbo/tree/master/dubbo-demo 这里面的,基于xml配置启动的和基于注解的都用

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