<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.0</li>
<li>Operating System version: windows 10</li>
<li>Java version: 1.8.1</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>hessian协议的接口使用配置mock，comsumr端发生异常</li>
</ol>
<p dir="auto">2、下面是对应的（hessian协议）Mock配置<br>
<em><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/service/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/service">@service</a>(version = "1.0.0", timeout = 10000, retries = 0, interfaceClass = LoadFileService.class,<br>
protocol = "hessian",<br>
mock = "com.dubbo.provider.service.file.LoadFileServiceMock")</em><br>
3. 下面是另一个接口（dubbo协议）的Mock配置<br>
<em><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/service/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/service">@service</a>(version = "1.0.0", timeout = 10000, interfaceClass = DefectService.class, protocol = "dubbo", mock = "com.dubbo.provider.service.defect.DefectServiceMock")</em></p>
<p dir="auto">配置dubbo协议的接口能正常使用mock返回，但是hessian的方法的consumer端会发生下面的警告，而且hessian协议接口的方法超时也不能正常返回mock的内容</p>
<p dir="auto"><em>com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method $echo in the service com.service.file.LoadFileService. Tried 3 times of the providers [169.254.126.158:20081] (1/1) from the registry 172.168.0.24:2181 on the consumer 169.254.126.158 using the dubbo version 2.6.0. Last error is: Failed to invoke remote proxy method $echo to hessian://169.254.126.158:20081/com.keystar.eprdms.service.file.LoadFileService?anyhost=true&amp;application=consumer&amp;check=false&amp;dubbo=2.6.0&amp;generic=false&amp;interface=com.service.file.LoadFileService&amp;methods=checkFileNameCriterion,generatePdfReport,checkDownloadFileCriterion,downloadReportPictures,downloadPreviewPicture,checkSingleFileNameCriterion,parallelDownloadPicture,uploadPicture,setThumbImageSize,deletePicture&amp;mock=com.keystar.eprdms.dubbo.provider.service.file.LoadFileServiceMock&amp;pid=15812&amp;register.ip=169.254.126.158&amp;remote.timestamp=1595574795792&amp;revision=1.0.0&amp;server=jetty&amp;side=consumer&amp;timeout=10000&amp;timestamp=1595574818277&amp;version=1.0.0, cause: Not found method "$echo" in class com.service.file.LoadFileService.<br>
at com.alibaba.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:101)<br>
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:232)<br>
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:80)<br>
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:51)<br>
at com.alibaba.dubbo.common.bytecode.proxy5.$echo(proxy5.java)<br>
at com.alibaba.dubbo.spring.boot.health.DubboHealthIndicator.doHealthCheck(DubboHealthIndicator.java:29)<br>
at org.springframework.boot.actuate.health.AbstractHealthIndicator.health(AbstractHealthIndicator.java:84)<br>
at org.springframework.boot.actuate.health.CompositeHealthIndicator.health(CompositeHealthIndicator.java:98)<br>
at org.springframework.boot.actuate.health.HealthEndpoint.health(HealthEndpoint.java:50)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
at java.lang.reflect.Method.invoke(Method.java:498)<br>
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:246)<br>
at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76)<br>
at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:61)<br>
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:126)<br>
at org.springframework.boot.actuate.endpoint.jmx.EndpointMBean.invoke(EndpointMBean.java:99)<br>
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)<br>
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)<br>
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)<br>
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)<br>
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)<br>
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)<br>
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)<br>
at sun.reflect.GeneratedMethodAccessor260.invoke(Unknown Source)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
at java.lang.reflect.Method.invoke(Method.java:498)<br>
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)<br>
at sun.rmi.transport.Transport$1.run(Transport.java:200)<br>
at sun.rmi.transport.Transport$1.run(Transport.java:197)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)<br>
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)<br>
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:834)<br>
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)<br>
at java.security.AccessController.doPrivileged(Native Method)<br>
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)<br>
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)<br>
at java.lang.Thread.run(Thread.java:748)<br>
Caused by: com.alibaba.dubbo.common.bytecode.NoSuchMethodException: Not found method "$echo" in class com.service.file.LoadFileService.<br>
at com.alibaba.dubbo.common.bytecode.Wrapper5.invokeMethod(Wrapper5.java)<br>
at com.alibaba.dubbo.rpc.proxy.javassist.JavassistProxyFactory$1.doInvoke(JavassistProxyFactory.java:45)<br>
at com.alibaba.dubbo.rpc.proxy.AbstractProxyInvoker.invok</em></p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.5-SNAPSHOT</li>
<li>Operating System version: Max OS 10.14.5</li>
<li>Java version:  Oracle jdk 1.8.0_131</li>
</ul>
<p dir="auto">git HEAD (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/dubbo/commit/15d808446d4bebc3b87f986ccc657f9e5baff728/hovercard" href="https://github.com/apache/dubbo/commit/15d808446d4bebc3b87f986ccc657f9e5baff728"><tt>15d8084</tt></a>) on master branch<br>
when building</p>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>checkout master branch</li>
<li>checkout HEAD <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/dubbo/commit/15d808446d4bebc3b87f986ccc657f9e5baff728/hovercard" href="https://github.com/apache/dubbo/commit/15d808446d4bebc3b87f986ccc657f9e5baff728"><tt>15d8084</tt></a></li>
<li>run command: ./mvnw clean install</li>
<li>The following Unit test is failing, the log message looks like:</li>
</ol>
<p dir="auto">[INFO] Running org.apache.dubbo.registry.multicast.MulticastRegistryTest<br>
log4j:WARN No appenders could be found for logger (org.apache.dubbo.common.logger.LoggerFactory).<br>
log4j:WARN Please initialize the log4j system properly.<br>
log4j:WARN See <a href="http://logging.apache.org/log4j/1.2/faq.html#noconfig" rel="nofollow">http://logging.apache.org/log4j/1.2/faq.html#noconfig</a> for more info.<br>
java.net.SocketException: Invalid argument<br>
at java.net.PlainDatagramSocketImpl.join(Native Method)<br>
at java.net.AbstractPlainDatagramSocketImpl.join(AbstractPlainDatagramSocketImpl.java:178)<br>
at java.net.MulticastSocket.joinGroup(MulticastSocket.java:323)<br>
at org.apache.dubbo.registry.multicast.MulticastRegistryTest.testMulticastAddress(MulticastRegistryTest.java:252)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br>
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)<br>
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
at java.lang.reflect.Method.invoke(Method.java:498)<br>
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:628)<br>
at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:117)<br>
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:184)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:180)<br>
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:127)<br>
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:68)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:135)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)<br>
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)<br>
at java.util.ArrayList.forEach(ArrayList.java:1249)<br>
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)<br>
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)<br>
at java.util.ArrayList.forEach(ArrayList.java:1249)<br>
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:139)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:125)<br>
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:135)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:123)<br>
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:122)<br>
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:80)<br>
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)<br>
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)<br>
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)<br>
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)<br>
at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)<br>
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)<br>
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)<br>
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)<br>
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:142)<br>
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:117)<br>
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)<br>
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)<br>
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)<br>
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)<br>
[ERROR] Tests run: 12, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 38.272 s &lt;&lt;&lt; FAILURE! - in org.apache.dubbo.registry.multicast.MulticastRegistryTest<br>
[ERROR] testSubscribe  Time elapsed: 1.023 s  &lt;&lt;&lt; FAILURE!<br>
org.opentest4j.AssertionFailedError: expected: dubbo://192.168.50.37/org.apache.dubbo.test.injvmServie?methods=test1,test2 but was: empty://192.168.50.37/org.apache.dubbo.test.injvmServie?methods=test1,test2<br>
at org.apache.dubbo.registry.multicast.MulticastRegistryTest.testSubscribe(MulticastRegistryTest.java:135)</p>
<p dir="auto">[INFO] Running org.apache.dubbo.registry.multicast.MulticastRegistryFactoryTest<br>
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.04 s - in org.apache.dubbo.registry.multicast.MulticastRegistryFactoryTest<br>
[INFO]<br>
[INFO] Results:<br>
[INFO]<br>
[ERROR] Failures:<br>
[ERROR]   MulticastRegistryTest.testSubscribe:135 expected: dubbo://192.168.50.37/org.apache.dubbo.test.injvmServie?methods=test1,test2 but was: empty://192.168.50.37/org.apache.dubbo.test.injvmServie?methods=test1,test2<br>
[INFO]<br>
[ERROR] Tests run: 13, Failures: 1, Errors: 0, Skipped: 0</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The project should build successfully/</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">MulticastRegistryTest.testSubscribe() test failed thus breaks the build.<br>
The trace is seen as above.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"><code class="notranslate"></code></pre></div>