2
Ask your question here
版本:dubbo 3.1.7 端口协议复用支持rest吗?比如使用以下配置
dubbo:
protocol:
name: dubbo
port: 30060
threads: 800
ext-protocol: rest,
经过尝试,现在dubbo3.1.7会抛出下面的异常信息,貌似dubbo会新创建一个jetty来响应rest请求,而不会像文档中提到的一样通过切换netty的ServerPipeline来实现
ava.lang.IllegalStateException: Failed to start jetty server on 172.16.192.55:30060, cause: Failed to bind to 0.0.0.0/0.0.0.0:30060
at org.apache.dubbo.remoting.http.jetty.JettyHttpServer.<init>(JettyHttpServer.java:90) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.remoting.http.jetty.JettyHttpBinder.bind(JettyHttpBinder.java:31) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.remoting.http.HttpBinder$Adaptive.bind(HttpBinder$Adaptive.java) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.rest.DubboHttpProtocolServer.doStart(DubboHttpProtocolServer.java:54) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.rest.BaseRestProtocolServer.start(BaseRestProtocolServer.java:47) ~[dubbo-3.1.7.jar:3.1.7]
at com.gemantic.wealth.WealthRestProtocol.lambda$doExport$1(WealthRestProtocol.java:45) ~[dubbo-ext-rest-choosable-annotation-1.0.0-SNAPSHOT.jar:?]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_221]
at com.gemantic.wealth.WealthRestProtocol.doExport(WealthRestProtocol.java:42) ~[dubbo-ext-rest-choosable-annotation-1.0.0-SNAPSHOT.jar:?]
at org.apache.dubbo.rpc.protocol.AbstractProxyProtocol.export(AbstractProxyProtocol.java:90) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:77) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:66) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$3(RegistryProtocol.java:297) ~[dubbo-3.1.7.jar:3.1.7]
at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_221]
at org.apache.dubbo.registry.integration.RegistryProtocol.doLocalExport(RegistryProtocol.java:295) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.registry.integration.RegistryProtocol.export(RegistryProtocol.java:241) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:77) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:80) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:64) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:58) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:717) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:695) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:651) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:445) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:429) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:391) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:243) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:350) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:322) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:158) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:139) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:113) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:102) ~[dubbo-3.1.7.jar:3.1.7]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:47) ~[dubbo-3.1.7.jar:3.1.7]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:421) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:378) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:938) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.25.jar:5.3.25]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:731) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:408) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.7.9.jar:2.7.9]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164) ~[spring-boot-2.7.9.jar:2.7.9]
at com.gemantic.wealth.user.server.Server.main(Server.java:39) ~[classes/:?]
Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:30060
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:349) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.Server.doStart(Server.java:401) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.apache.dubbo.remoting.http.jetty.JettyHttpServer.<init>(JettyHttpServer.java:87) ~[dubbo-3.1.7.jar:3.1.7]
... 50 more
Caused by: java.net.BindException: Address already in use: bind
at sun.nio.ch.Net.bind0(Native Method) ~[?:1.8.0_221]
at sun.nio.ch.Net.bind(Net.java:433) ~[?:1.8.0_221]
at sun.nio.ch.Net.bind(Net.java:425) ~[?:1.8.0_221]
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) ~[?:1.8.0_221]
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) ~[?:1.8.0_221]
at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:344) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:310) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:234) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.server.Server.doStart(Server.java:401) ~[jetty-server-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:73) ~[jetty-util-9.4.50.v20221201.jar:9.4.50.v20221201]
at org.apache.dubbo.remoting.http.jetty.JettyHttpServer.<init>(JettyHttpServer.java:87) ~[dubbo-3.1.7.jar:3.1.7]
... 50 more