-
Pre-check
Apache Dubbo ComponentJava SDK (apache/dubbo) DetailsI am running the java.lang.IllegalStateException: No such extension org.apache.dubbo.rpc.Protocol by name rest, no related exception was found, please check whether related SPI module is missing.
at org.apache.dubbo.common.extension.ExtensionLoader.findException(ExtensionLoader.java:768) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:775) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:575) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:549) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.findConfiguredPort(ServiceConfig.java:1107) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.buildUrl(ServiceConfig.java:831) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:615) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:600) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:555) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:343) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:495) ~[dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:442) [dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:177) [dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:159) [dubbo-config-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:167) [dubbo-config-spring-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:153) [dubbo-config-spring-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) [dubbo-config-spring-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:430) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:387) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:952) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:594) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144) [spring-context-5.3.39.jar!/:5.3.39]
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:95) [spring-context-5.3.39.jar!/:5.3.39]
at org.apache.dubbo.demo.rest.api.SpringMvcRestProvider.main(SpringMvcRestProvider.java:24) [classes!/:3.3.2-SNAPSHOT]
... suppressed 4 lines
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) [dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) [dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT]
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) [dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT]
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:65) [dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT] I know this error is because of rest protocol is moved to dubbo-spi-extensions respository. So I add dependency of <dependency>
<groupId>org.apache.dubbo</groupId>
<artifactId>dubbo-rpc-rest</artifactId>
<version>3.3.0-beta.2</version>
</dependency> After that, I run the java.lang.ClassNotFoundException: org.apache.dubbo.remoting.api.AbstractHttpProtocolDetector
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445) ~[?:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
at java.base/java.lang.ClassLoader.defineClass1(Native Method) ~[?:?]
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017) ~[?:?]
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150) ~[?:?]
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524) ~[?:?]
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427) ~[?:?]
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421) ~[?:?]
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712) ~[?:?]
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420) ~[?:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151) ~[dubbo-demo-spring-mvc-rest-provider-3.3.2-SNAPSHOT.jar:3.3.2-SNAPSHOT]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
at org.apache.dubbo.rpc.protocol.rest.pu.RestHttp1WireProtocol.<init>(RestHttp1WireProtocol.java:47) ~[dubbo-rpc-rest-3.3.0-beta.2.jar!/:3.3.0-beta.2]
... suppressed 5 lines
at org.apache.dubbo.common.beans.support.InstantiationStrategy.instantiate(InstantiationStrategy.java:94) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.createExtensionInstance(ExtensionLoader.java:824) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.createExtension(ExtensionLoader.java:780) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:575) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.getExtension(ExtensionLoader.java:549) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.lambda$getActivateExtension$4(ExtensionLoader.java:400) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721) ~[?:?]
at java.base/java.util.Collections$SynchronizedMap.forEach(Collections.java:2735) ~[?:?]
at org.apache.dubbo.common.extension.ExtensionLoader.getActivateExtension(ExtensionLoader.java:394) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.common.extension.ExtensionLoader.getActivateExtension(ExtensionLoader.java:316) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.api.pu.AbstractPortUnificationServer.<init>(AbstractPortUnificationServer.java:59) ~[dubbo-remoting-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationServer.<init>(NettyPortUnificationServer.java:80) ~[dubbo-remoting-netty4-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.transport.netty4.NettyPortUnificationTransporter.bind(NettyPortUnificationTransporter.java:34) ~[dubbo-remoting-netty4-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.api.pu.PortUnificationTransporter$Adaptive.bind(PortUnificationTransporter$Adaptive.java) ~[dubbo-remoting-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.exchange.PortUnificationExchanger.lambda$bind$0(PortUnificationExchanger.java:46) ~[dubbo-remoting-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?]
at org.apache.dubbo.common.utils.ConcurrentHashMapUtils.computeIfAbsent(ConcurrentHashMapUtils.java:56) ~[dubbo-common-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.remoting.exchange.PortUnificationExchanger.bind(PortUnificationExchanger.java:43) ~[dubbo-remoting-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.rest.RestProtocol.export(RestProtocol.java:105) ~[dubbo-rpc-rest-3.3.0-beta.2.jar!/:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:84) ~[dubbo-rpc-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:77) ~[dubbo-rpc-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) ~[dubbo-cluster-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:50) ~[dubbo-rpc-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) ~[dubbo-rpc-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-rpc-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$3(RegistryProtocol.java:354) ~[dubbo-registry-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
at org.apache.dubbo.registry.integration.ExporterFactory.lambda$createExporter$0(ExporterFactory.java:31) ~[dubbo-registry-api-3.3.2-SNAPSHOT.jar!/:3.3.2-SNAPSHOT]
... 42 more I search this problem in this forum and google. However, I do not find any solutions. Is there any one know how to run this Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
You should import https://github.com/apache/dubbo-spi-extensions/tree/master/dubbo-rpc-extensions/dubbo-rpc-rest instead of the old version of the package |
Beta Was this translation helpful? Give feedback.
-
Try
|
Beta Was this translation helpful? Give feedback.
-
I have searched many dubbo rest rpc call demos, but I do not find a one can be run successfully. I can call dubbo provider by http urls, but I cannot call it by dubbo consumer. And I do not have a idea about how to solve this problem, what I find is consumer timeout and it seems that the provider do not receive a remote call. |
Beta Was this translation helpful? Give feedback.
-
I have known the problem is why. If my macbook is connected to a WiFi, my macbook will have a new Ip address, just like 7.250.138.200. This Ip is allocated by the WiFi, and my macbook can visit the Internet throught this Ip. However, the other cannot visit my macbook through this Ip. When my macbook is connected to the WiFi, the dubbo rest provider will be exposed to the 127.0.0.1, but in the registory center, the Ip is 7.250.138.200. So we can visit the 127.0.0.1 to call the rest provider through http request and cannot visit the 7.250.138.200 to call the rest provider through dubbo rest consumer. As long as I close my WiFi, the dubbo rest consumer can do rpc to call the dubbo rest provider. |
Beta Was this translation helpful? Give feedback.
-
If you plan to use dubbo 3.3, it is recommended to use the new triple rest: |
Beta Was this translation helpful? Give feedback.
I have known the problem is why.
If my macbook is connected to a WiFi, my macbook will have a new Ip address, just like 7.250.138.200. This Ip is allocated by the WiFi, and my macbook can visit the Internet throught this Ip. However, the other cannot visit my macbook through this Ip.
When my macbook is connected to the WiFi, the dubbo rest provider will be exposed to the 127.0.0.1, but in the registory center, the Ip is 7.250.138.200. So we can visit the 127.0.0.1 to call the rest provider through http request and cannot visit the 7.250.138.200 to call the rest provider through dubbo rest consumer. As long as I close my WiFi, the dubbo rest consumer can do rpc to call the dubbo rest prov…