Open khiker007 opened 4 years ago
could you provide a project that reproduces the issue?
could you provide a project that reproduces the issue?
https://github.com/khiker007/dubbo-spring-version.git 先用test1和test2环境变量启动producer,然后启动consumer,consumer有一定概率启动不起来,及使启动起来,访问接口/test1或/tes2,有一半的概率会找不到service报错
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.dubbo.rpc.RpcException: Failed to invoke the method test1 in the service com.fshares.chain.service.ITest1. Tried 1 times of the providers [172.16.17.5:20880] (1/2) from the registry localhost:9090 on the consumer 172.16.17.5 using the dubbo version 2.7.3. Last error is: Failed to invoke remote method: test1, provider: dubbo://172.16.17.5:20880/com.fshares.chain.service.ITest1?anyhost=true&application=api-core&bean.name=ServiceBean:com.fshares.chain.service.ITest1:1.0.1:test-2&check=false&delay=-1&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=test-2&heartbeat=5000&interface=com.fshares.chain.service.ITest1&keep.alive=true&lazy=false&methods=test1&payload=16777216&pid=21844&qos.enable=false®ister=true®ister.ip=172.16.17.5&release=2.7.3&remote.application=producer-1&retries=0&revision=1.0.1&serialization=kryo&side=consumer&status=server&sticky=false&timeout=10000×tamp=1577945345306&version=1.0.1, cause: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:266)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:127)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:102)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:193)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:645) ~[javax.servlet-api-4.0.1.jar:4.0.1]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[javax.servlet-api-4.0.1.jar:4.0.1]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:68) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.RedirectDirHandler.handleRequest(RedirectDirHandler.java:68) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:132) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77) ~[undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) ~[undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:269) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:78) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:133) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:130) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:249) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:78) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:99) [undertow-servlet-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:376) [undertow-core-2.0.28.Final.jar:2.0.28.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830) [undertow-core-2.0.28.Final.jar:2.0.28.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_201]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_201]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]
Caused by: org.apache.dubbo.rpc.RpcException: Failed to invoke the method test1 in the service com.fshares.chain.service.ITest1. Tried 1 times of the providers [172.16.17.5:20880] (1/2) from the registry localhost:9090 on the consumer 172.16.17.5 using the dubbo version 2.7.3. Last error is: Failed to invoke remote method: test1, provider: dubbo://172.16.17.5:20880/com.fshares.chain.service.ITest1?anyhost=true&application=api-core&bean.name=ServiceBean:com.fshares.chain.service.ITest1:1.0.1:test-2&check=false&delay=-1&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=test-2&heartbeat=5000&interface=com.fshares.chain.service.ITest1&keep.alive=true&lazy=false&methods=test1&payload=16777216&pid=21844&qos.enable=false®ister=true®ister.ip=172.16.17.5&release=2.7.3&remote.application=producer-1&retries=0&revision=1.0.1&serialization=kryo&side=consumer&status=server&sticky=false&timeout=10000×tamp=1577945345306&version=1.0.1, cause: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:266)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:127)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:102)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:193)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:113) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:248) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:78) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:55) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.common.bytecode.proxy1.test1(proxy1.java) ~[dubbo-common-2.7.3.jar:2.7.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.apache.dubbo.config.spring.beans.factory.annotation.ReferenceAnnotationBeanPostProcessor$ReferenceBeanInvocationHandler.invoke(ReferenceAnnotationBeanPostProcessor.java:260) ~[dubbo-2.7.3.jar:2.7.3]
at com.sun.proxy.$Proxy91.test1(Unknown Source) ~[na:na]
at com.fashares.chain.controller.TestController.test1(TestController.java:26) ~[classes/:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.1.12.RELEASE.jar:5.1.12.RELEASE]
... 51 common frames omitted
Caused by: java.util.concurrent.ExecutionException: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:266)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:127)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:102)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:193)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ~[na:1.8.0_201]
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1915) ~[na:1.8.0_201]
at org.apache.dubbo.rpc.protocol.AsyncToSyncInvoker.invoke(AsyncToSyncInvoker.java:56) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:92) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:54) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:58) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:82) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$CallbackRegistrationInvoker.invoke(ProtocolFilterWrapper.java:157) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:78) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.InvokerWrapper.invoke(InvokerWrapper.java:56) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:82) ~[dubbo-2.7.3.jar:2.7.3]
... 75 common frames omitted
Caused by: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: test-2/com.fshares.chain.service.ITest1:1.0.1:20880 in [producer-1/com.alibaba.cloud.dubbo.service.DubboMetadataService:1.0.0:20880, test-1/com.fshares.chain.service.ITest1:1.0.0:20880, test-1/com.fshares.chain.service.ITest2:1.0.0:20880], may be version or group mismatch , channel: consumer: /172.16.17.5:54431 --> provider: /172.16.17.5:20880, message:RpcInvocation [methodName=test1, parameterTypes=[class java.lang.String], arguments=[111], attachments={path=com.fshares.chain.service.ITest1, input=189, dubbo=2.0.2, interface=com.fshares.chain.service.ITest1, version=1.0.1, timeout=10000, group=test-2}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:266)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:127)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:102)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:193)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at org.apache.dubbo.remoting.exchange.support.DefaultFuture.doReceived(DefaultFuture.java:191) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:153) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.support.DefaultFuture.received(DefaultFuture.java:141) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleResponse(HeaderExchangeHandler.java:62) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:199) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57) ~[dubbo-2.7.3.jar:2.7.3]
... 3 common frames omitted
Process finished with exit code -1
well,I try dubbo-spring-starter 2.7.5,it is fix this bug,and I hope its working well spring-cloud-alibaba as soon as posiable
可以看源码在 AbstractSpringCloudRegistry里,首先先服务引用方配置subscribed-services的serviceName 去拿到 List serviceInstances 和 数据大概是这样的,
然后 findAny 一个 serviceInstance 生成dubboMetadataService的代理
然后调用 dubboMetadataService.getExportedURLs(serviceInterface,group, version) 其中 group 和 version 是 consumer配置的参数,真实的执行是走rpc去serviceInstance提供方获取匹配的providerURL "dubbo://10.0.31.43:20880/com.melot.dubbo.service.HelloService?anyhost=true&application=provider-service&bean.name=ServiceBean:com.melot.dubbo.service.HelloService:nodejs&deprecated=false&dubbo=2.0.2&dynamic=true&generic=false&group=nodejs&interface=com.melot.dubbo.service.HelloService&methods=test,getUser&pid=25564&release=2.7.4.1&side=provider×tamp=1597059092983"
问题就出在这里,findAny 的serviceInstance 若恰好没有你的group version,那就是启动失败,
若有,他会根据获取的providerURL 和 List serviceInterfaces 里 host port 等信息,组合成 List subcriberURl 通知到 RegistryDirectory 开始生成 invokers,注意 List subcriberURl 里面有一个是错误的,因为List subcriberURl 里的group 和 version 组合生产的,是一样的,而另一个服务是没有 对应subcriberURl的 group version,所以请求到该服务时会Not found exported service
你用的springcloud版本是哪一个,我用2.2.0.RELEASE版本 version一样 group不一样,启动和请求都是ok的,
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。 We recommend using English. If you are non-native English speaker, you can use the translation software.
Which Component
Nacos Discovery,spring-cloud-alibaba 2.1.1
Describe the bug
同一个dubbo服务,有两个版本,在service注解中使用不同的group和version,但是在消费端使用Reference注解,指定引用其中一个group和version启动报错,把不引用的再nacos中下线,则可以正常启动
two dubbo provider,same project name,but have diff provider group and version,consumer Reference one of the group and version,Not found exported service
希望同一服务的service可以支持不同版本同时在线,调用端根据service的group和version调用不同的服务