No such extension org.apache.dubbo.metadata.report.MetadataReportFactory by name dubbo, no related exception was found, please check whether related SPI module is missing
- [x] I have searched the issues of this repository and believe that this is not a duplicate.
- [x] I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 3.0.1
- Operating System version: Linux or Win
- Java version: 1.8
Steps to reproduce this issue
- Start Dubbo by xml use of org.apache.dubbo.container.Main
xml config of dubbo service ( it is both of provider and comsumer )
<dubbo:application name="demo-service" owner="${dubbo.owner}" organization="${dubbo.organization}"
metadata-type="remote" />
<dubbo:metadata-report address="${zookeeper.address}"/>
<dubbo:config-center address="${zookeeper.address}"/>
<dubbo:registry protocol="zookeeper" address="${zookeeper.address}" file="${dubbo.registry.cache}"/>
<dubbo:provider timeout="${dubbo.service.timeout}" version="${dubbo.service.version}"/>
<dubbo:consumer timeout="${dubbo.service.timeout}" version="${dubbo.service.version}" retries="0"/>
<dubbo:monitor protocol="${platform.dubbo.monitor}"/>
<dubbo:protocol name="dubbo" serialization="kryo" host="${dubbo.host}" port="${dubbo.port}" payload="104857600" />
all config of POM relative with Dubbo
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-multicast</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-registry-zookeeper</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-configcenter-zookeeper</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-dependencies-zookeeper</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-metadata-api</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-metadata-report-zookeeper</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-dubbo</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-config-spring</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-remoting-netty4</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-qos</artifactId>
<version>3.0.1</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-serialization-kryo</artifactId>
<version>2.7.12</version>
</dependency>
exception trace:
[2021-07-11 23:10:10] [ERROR] - [DUBBO] No such extension org.apache.dubbo.metadata.report.MetadataReportFactory by name dubbo, no related exception was found, please check whether related SPI module is missing., dubbo version: 3.0.1, current host: 169.254.166.203
java.lang.IllegalStateException: No such extension org.apache.dubbo.metadata.report.MetadataReportFactory by name dubbo, no related exception was found, please check whether related SPI module is missing.
at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:670)
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:677)
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:477)
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:461)
at org.apache.dubbo.metadata.report.MetadataReportFactory$Adaptive.getMetadataReport(MetadataReportFactory$Adaptive.java)
at org.apache.dubbo.metadata.report.MetadataReportInstance.init(MetadataReportInstance.java:60)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.startMetadataCenter(DubboBootstrap.java:767)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.initialize(DubboBootstrap.java:561)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:1091)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:80)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:72)
at com.alibaba.spring.context.OnceApplicationContextEventListener.onApplicationEvent(OnceApplicationContextEventListener.java:52)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.apache.dubbo.container.spring.SpringContainer.start(SpringContainer.java:50)
at org.apache.dubbo.container.Main.main(Main.java:90)
<dubbo:metadata-report address="${zookeeper.address}"/>
->
<dubbo:metadata-report protocol="zookeeper" address="${zookeeper.address}"/>
@horizonzy thx ! but <dubbo:metadata-report ... /> is not support attribute “protocol ”, it is only work at
<dubbo:registry protocol="zookeeper"
just like my description ~
Ok, I will make it support protocol later. Supply a workaround, config ${zookeeper.address} with protocol, like "zookeeper://xx.xx.xx.xx:2181".
@horizonzy thx ! it is work for me , but take another exception trace :
[ERROR] - [DUBBO] [source error] getExportedURLs() not found in org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService, dubbo version: 3.0.1, current host: 169.254.166.203
java.lang.RuntimeException: [source error] getExportedURLs() not found in org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService
at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:344)
at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:285)
at org.apache.dubbo.common.bytecode.Wrapper.makeWrapper(Wrapper.java:277)
at org.apache.dubbo.common.bytecode.Wrapper$$Lambda$219/662109583.apply(Unknown Source)
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660)
at org.apache.dubbo.common.bytecode.Wrapper.getWrapper(Wrapper.java:121)
at org.apache.dubbo.rpc.proxy.javassist.JavassistProxyFactory.getInvoker(JavassistProxyFactory.java:41)
at org.apache.dubbo.rpc.proxy.wrapper.StubProxyFactoryWrapper.getInvoker(StubProxyFactoryWrapper.java:119)
at org.apache.dubbo.rpc.ProxyFactory$Adaptive.getInvoker(ProxyFactory$Adaptive.java)
at org.apache.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:565)
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:499)
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:362)
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:338)
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:231)
at org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter.export(ConfigurableMetadataServiceExporter.java:83)
at org.apache.dubbo.config.metadata.ConfigurableMetadataServiceExporter.export(ConfigurableMetadataServiceExporter.java:55)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportMetadataService(DubboBootstrap.java:1270)
at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:1101)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:80)
at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:72)
at com.alibaba.spring.context.OnceApplicationContextEventListener.onApplicationEvent(OnceApplicationContextEventListener.java:52)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:898)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:554)
at org.apache.dubbo.container.spring.SpringContainer.start(SpringContainer.java:50)
at org.apache.dubbo.container.Main.main(Main.java:90)
Caused by: javassist.CannotCompileException: [source error] getExportedURLs() not found in org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService
at javassist.CtNewMethod.make(CtNewMethod.java:79)
at javassist.CtNewMethod.make(CtNewMethod.java:45)
at org.apache.dubbo.common.bytecode.ClassGenerator.toClass(ClassGenerator.java:321)
... 29 more
Caused by: compile error: getExportedURLs() not found in org.apache.dubbo.registry.client.metadata.store.InMemoryWritableMetadataService
at javassist.compiler.TypeChecker.atMethodCallCore(TypeChecker.java:723)
at javassist.compiler.TypeChecker.atCallExpr(TypeChecker.java:688)
at javassist.compiler.JvstTypeChecker.atCallExpr(JvstTypeChecker.java:157)
at javassist.compiler.ast.CallExpr.accept(CallExpr.java:46)
at javassist.compiler.JvstTypeChecker.atCastToWrapper(JvstTypeChecker.java:126)
at javassist.compiler.JvstTypeChecker.atCastExpr(JvstTypeChecker.java:98)
at javassist.compiler.ast.CastExpr.accept(CastExpr.java:55)
at javassist.compiler.CodeGen.doTypeCheck(CodeGen.java:242)
at javassist.compiler.CodeGen.compileExpr(CodeGen.java:229)
at javassist.compiler.CodeGen.atReturnStmnt2(CodeGen.java:598)
at javassist.compiler.JvstCodeGen.atReturnStmnt(JvstCodeGen.java:425)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:363)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at javassist.compiler.CodeGen.atIfStmnt(CodeGen.java:391)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:355)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at javassist.compiler.CodeGen.atStmnt(CodeGen.java:351)
at javassist.compiler.ast.Stmnt.accept(Stmnt.java:50)
at javassist.compiler.CodeGen.atMethodBody(CodeGen.java:292)
at javassist.compiler.CodeGen.atMethodDecl(CodeGen.java:274)
at javassist.compiler.ast.MethodDecl.accept(MethodDecl.java:44)
at javassist.compiler.Javac.compileMethod(Javac.java:169)
at javassist.compiler.Javac.compile(Javac.java:95)
lastest provider xml like this
<dubbo:application name="workbench-service" owner="${dubbo.owner}" organization="${dubbo.organization}"/>
<dubbo:config-center address="zookeeper://192.168.1.11:2181"/>
<dubbo:metadata-report address="zookeeper://192.168.1.11:2181"/>
<dubbo:registry id="registry1" address="zookeeper://192.168.1.11:2181?registry-type=service" />
<dubbo:provider timeout="${dubbo.service.timeout}" version="${dubbo.service.version}"/>
<dubbo:consumer timeout="${dubbo.service.timeout}" version="${dubbo.service.version}" retries="0"/>
<dubbo:monitor protocol="${platform.dubbo.monitor}"/>
<dubbo:protocol name="dubbo" serialization="kryo" host="${dubbo.host}" port="${dubbo.port}" payload="104857600" />
<dubbo:service delay="5000" registry="registry1" interface="com.demo.workbenchService" ref="workbenchServiceImpl" protocol="dubbo" />
InMemoryWritableMetadataService
Please check if all of the dubbo dependencies are the same version
@AlbumenJ thx ! but I comfirm all about the Dubbo use the same version, because they are import by this :
...
<version>3.0.1</version>
...
@AlbumenJ Another important thing , The above configuration works in dubbo-2.7.11
Please check if you are depend on both dubbo 2.7 and 3.0.
thx ~ , I'll confirm it carefully again
and I check another different between 2.7.x and 3.0.x like this in class DubboBootstrap
executorRepository.nextScheduledExecutor().scheduleAtFixedRate(() -> {
InMemoryWritableMetadataService localMetadataService = (InMemoryWritableMetadataService) WritableMetadataService.getDefaultExtension();
localMetadataService.blockUntilUpdated();
try {
ServiceInstanceMetadataUtils.refreshMetadataAndInstance(serviceInstance);
} catch (Exception e) {
logger.error("Refresh instance and metadata error", e);
}
}, 0, ConfigurationUtils.get(METADATA_PUBLISH_DELAY_KEY, DEFAULT_METADATA_PUBLISH_DELAY), TimeUnit.MILLISECONDS);
in other word InMemoryWritableMetadataService Is automatically initialized, Is it related to this place?
@AlbumenJ
it is actually not present both dubbo 2.7 and 3.0, and only 3.0.1
I will close this issue , and create new isssue for the new question , and the solution of this issue is confirm all dubbo dependencies are the same version ,and the dubbo-config.xml should be set the registry correctly just like :
<dubbo:registry id="registry1" address="zookeeper://192.168.1.110:2181?registry-type=service" check="false"/>
<dubbo:config-center address="zookeeper://192.168.1.110:2181"/>
<dubbo:metadata-report address="zookeeper://192.168.1.110:2181"/>