You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Anyzm (GitHub)" <gi...@apache.org> on 2019/11/28 14:06:15 UTC
[GitHub] [dubbo] Anyzm opened issue #5398: the multi-protocol problem
of dubbo 2.7.2
### Environment
* Dubbo version: 2.7.2
* Operating System version: win10
* Java version: 1.8
### Steps to reproduce this issue
1. config
```
<dubbo:protocol name="dubbo" ……
<dubbo:protocol name="hessian" ……
```
in the xml
2. config
```
<dubbo:provider protocol="dubbo" default="true"/>
```
in the xml
3. then run application and it reports a error:
```
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dubbo' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:775) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
```
### Expected Result
application run up normal and it only default provides "dubbo" service
### Actual Result
application cannot run up and report a error
and if i reduce the config
```
<dubbo:provider protocol="dubbo" default="true"/>
```
the application can run up,but all the service of no specified protocol both provide "dubbo" and "hessain" service,this is not my expect,could you please help me solve the problem?
```
2019-11-28 21:52:22.379 DEBUG [ main] [mainraceId|] o.s.b.d.LoggingFailureAnalysisReporter : Application failed to start due to an exception
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dubbo' available
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:775) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1221) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:294) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:367) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1681) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1433) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.4.RELEASE.jar:2.1.4.RELEASE]
at xxxx.main(xxxAppApplication.java:19) [classes/:?]
```
[ Full content available at: https://github.com/apache/dubbo/issues/5398 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] chickenlj closed issue #5398: the multi-protocol
problem of dubbo 2.7.2
Posted by "chickenlj (GitHub)" <gi...@apache.org>.
[ issue closed by chickenlj ]
[ Full content available at: https://github.com/apache/dubbo/issues/5398 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org
[GitHub] [dubbo] Anyzm commented on issue #5398: the multi-protocol
problem of dubbo 2.7.2
Posted by "Anyzm (GitHub)" <gi...@apache.org>.
> The bean name will use the protocol name, this should not happen. so can y provide a complete configuration ?
we have tow configurations,apollo and xml。
in the apollo:
```
dubbo.registry.address = ……
dubbo.metadata-report.address = ……
dubbo.registry.simplified = true
dubbo.protocol.name = dubbo
dubbo.protocol.port = -1
dubbo.provider.timeout = 3000
dubbo.provider.delay = 0
dubbo.consumer.check = false
```
in the xml:
```
<dubbo:protocol name="hessian" default="false" port="${dubbo.protocol.hessian.port}" server="jetty" threads="${dubbo.protocol.hessian.threads}" >
<dubbo:parameter key="hessian.overload.method" value="true"/>
</dubbo:protocol>
<dubbo:service interface="xxxx1.xxxx1Facade" ref="xxxx1Facade" />
<dubbo:service interface="xxxx2.xxxx2Facade" ref="xxxx2Facade" protocol="hessian"/>
```
then the xxxx1Facade register tow protocol service。
and if i add
```
<dubbo:provider protocol="dubbo" default="true"/>
```
into the xml,the error shows :No bean named 'dubbo' available
[ Full content available at: https://github.com/apache/dubbo/issues/5398 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org