yangfuhai / jboot

一个优雅的微服务框架,SpringCloud 之外的另一个选择,已经使用在用户量过亿的商业产品上,有超过1000家公司在使用Jboot做极速开发...
http://www.jboot.com.cn
Apache License 2.0
732 stars 252 forks source link

升级到3.1.x之后,Dubbo配置无效 #82

Closed Einstein-github closed 3 years ago

Einstein-github commented 4 years ago

之前是基于jboot.properties中配置Dubbo引用Provider,例如

MongoDB的服务的配置:

group:application.provider.mongodb.group = mongodbApplication version: application.provider.mongodb.version = 1 在Mall项目中引入MongoDB的Provider
@RPCInject(group = "${application.provider.mongodb.group}", version = "${application.provider.mongodb.version}") public com.mars.core.provider.EmailServiceProvider emailServiceProvider ;

RPC 相关配置
jboot.rpc.type=dubbo jboot.rpc.registryType=zookeeper jboot.rpc.registryAddress=172.17.0.4:2181 jboot.rpc.registryCheck=true jboot.rpc.requestTimeOut=15000 jboot.rpc.retries=0

错误信息 [ERROR]-[Thread: main]-[io.jboot.aop.JbootAopFactory.doInjectRPC()]: can not inject rpc service in class com.mars.core.provider.email.EmailServiceProvider$$EnhancerByCGLIB$$7e3bd1d6 by config @io.jboot.components.rpc.annotation.RPCInject(registry=[], module=, loadbalance=random, monitor=, check=true, version=${application.version}, actives=0, generic=false, url=, timeout=0, retries=2, async=false, protocol=, application=, id=, tag=, consumer=, group=${application.name}) java.lang.IllegalStateException: Failed to check the status of the service com.mars.api.rpc.core.config.ISysConfigServiceProvider. No provider available for the service play-core-provider-dev/com.mars.api.rpc.core.config.ISysConfigServiceProvider:1 from the url zookeeper://172.16.20.214:2181/org.apache.dubbo.registry.RegistryService?application=tooth_beautiful&application.version=1&dubbo=2.0.2&group=play-core-provider-dev&interface=com.mars.api.rpc.core.config.ISysConfigServiceProvider&methods=findByConfigName,selectConfigListByConfigName,findByConfigNameAndConfigKey,findConfigValueToIntByConfigKey,saveOrUpdateSysConfig,findByConfigKey,findConfigValueByKey,selectByConfigName&pid=8620&qos.enable=false&register.ip=172.16.10.241&release=2.7.5&revision=1&side=consumer&sticky=false&timestamp=1597477784303&version=1 to the consumer 172.16.10.241 use dubbo version 2.7.5 at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:355) at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266) at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:151) at io.jboot.components.rpc.dubbo.JbootDubborpc.onServiceCreate(JbootDubborpc.java:61) at io.jboot.components.rpc.JbootrpcBase.serviceObtain(JbootrpcBase.java:45) at io.jboot.aop.JbootAopFactory.doInjectRPC(JbootAopFactory.java:194) at io.jboot.aop.JbootAopFactory.doInject(JbootAopFactory.java:126) at com.jfinal.aop.AopFactory.doGetSingleton(AopFactory.java:93) at com.jfinal.aop.AopFactory.doGet(AopFactory.java:65) at com.jfinal.aop.AopFactory.get(AopFactory.java:48) at com.jfinal.aop.Aop.get(Aop.java:101) at io.jboot.components.rpc.JbootrpcManager.exportRPCBean(JbootrpcManager.java:114) at io.jboot.components.rpc.JbootrpcManager.init(JbootrpcManager.java:75) at io.jboot.core.JbootCoreConfig.onStart(JbootCoreConfig.java:284) at com.jfinal.core.JFinalFilter.init(JFinalFilter.java:72) at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111) at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80) at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:591) at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:556) at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42) at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:598) at com.jfinal.server.undertow.UndertowServer.configHttp(UndertowServer.java:288) at com.jfinal.server.undertow.UndertowServer.doStart(UndertowServer.java:266) at com.jfinal.server.undertow.UndertowServer.start(UndertowServer.java:159) at io.jboot.app.JbootApplication.start(JbootApplication.java:42) at io.jboot.app.JbootApplication.run(JbootApplication.java:34) at com.mars.core.provider.CoreProviderApplication.main(CoreProviderApplication.java:8)

yangfuhai commented 3 years ago

3.1.0 之后 rpc 配置有改动,请查看文档。