Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

consul registry: NullPointerException #3923

Closed
byronzoz opened this issue Apr 24, 2019 · 9 comments
Closed

consul registry: NullPointerException #3923

byronzoz opened this issue Apr 24, 2019 · 9 comments
Assignees
Milestone

Comments

@byronzoz
Copy link

byronzoz commented Apr 24, 2019

[description]
simple test consul registry

java: 1.8
os: mac os
dubbo: 2.7.1

[problem]
I use zk as registry center, everything is fine. Now I change the registry to consul.

provider facade definition:

public interface SessionContentFacade {

   public String sayHello(String name);
}

public class SessionContentFacadeImpl implements SessionContentFacade {

    @Override
    public String sayHello(String name) {
        return name + ": hi";
    }
}

<!-- app -->
<dubbo:application name="provider" owner="byronzoz">
	<dubbo:parameter key="qos.enable" value="false" />
</dubbo:application>

<!-- registry -->
<dubbo:registry address="consul://10.100.12.2:8500" />

<!-- service -->
<dubbo:service interface="com.byronzoz.common.service.facade.SessionContentFacade" ref="sessionContentFacade" />

<!-- impl -->
<bean id="sessionContentFacade" class="com.byronzoz.biz.service.impl.SessionContentFacadeImpl" />

The service consumer side:

@Path("/api/v1.0/test")
@Produces({ ContentType.APPLICATION_JSON_UTF_8 })
public interface TestFacade {

    @GET
    @Path("/sayHello")
    public String call(@QueryParam("name") String name);
}

public class TestFacadeImpl implements TestFacade {

    @Autowired
    private SessionContentFacade sessionContentFacade;

    @Override
    public String call(String name) {
        return sessionContentFacade.sayHello(name);
    }
}
<!-- app -->
<dubbo:application name="consumer" owner="byronzoz">
	<dubbo:parameter key="qos.enable" value="false" />
</dubbo:application>

<!-- registry -->
<dubbo:registry address="consul://10.100.12.2:8500" />

<!-- expose rest rpc service -->
<dubbo:protocol name="rest" server="tomcat" port="8099" id="rest_protocol" />

<!-- service -->
<dubbo:service interface="com.byronzoz.common.service.facade.TestFacade" ref="testFacade" protocol="rest_protocol" />

<!-- impl -->
<bean id="testFacade" class="com.byronzoz.biz.service.impl.TestFacadeImpl" />

The service provider side: service started. Provider side uses dubbo as protocol. But consumer side throw NullPointerException as following:

waiting for retry, cause: null, dubbo version: 2.7.1, current host: 3.0.1.176
java.lang.NullPointerException
	at org.apache.dubbo.registry.consul.ConsulRegistry.lambda$convert$3(ConsulRegistry.java:203)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at org.apache.dubbo.registry.consul.ConsulRegistry.convert(ConsulRegistry.java:205)
	at org.apache.dubbo.registry.consul.ConsulRegistry.doSubscribe(ConsulRegistry.java:134)
	at org.apache.dubbo.registry.support.FailbackRegistry.subscribe(FailbackRegistry.java:290)
	at org.apache.dubbo.registry.consul.ConsulRegistry.subscribe(ConsulRegistry.java:118)
	at org.apache.dubbo.registry.integration.RegistryDirectory.subscribe(RegistryDirectory.java:157)
	at org.apache.dubbo.registry.integration.RegistryProtocol.doRefer(RegistryProtocol.java:386)
	at org.apache.dubbo.registry.integration.RegistryProtocol.refer(RegistryProtocol.java:367)
	at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper.refer(ProtocolFilterWrapper.java:114)
	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.refer(QosProtocolWrapper.java:70)
	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.refer(ProtocolListenerWrapper.java:65)
	at org.apache.dubbo.rpc.Protocol$Adaptive.refer(Protocol$Adaptive.java)
	at org.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:366)
	at org.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:305)
	at org.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:231)
	at org.apache.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:71)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1468)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:917)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:860)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:775)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:489)
	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:286)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1146)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:458)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:296)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:293)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:633)
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:932)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:479)
	at org.apache.dubbo.container.spring.SpringContainer.start(SpringContainer.java:50)
	at org.apache.dubbo.container.Main.main(Main.java:89)

[result]
Pls check consul registry implementation.

@Moriadry-zz
Copy link

hi, could you tell me what configuration you declared for consul registry, I would like to help with it.

@Moriadry-zz
Copy link

I just open a pr which contains the integration test about consul registry. check this #3906

It seems when we covert healthService to URL, some services got a null meta variable, so NPE happens. I can solve it ASAP.

@byronzoz
Copy link
Author

byronzoz commented Apr 24, 2019

@moriadry Hi buddy, How's it going

@byronzoz
Copy link
Author

I just open a pr which contains the integration test about consul registry. check this #3906

It seems when we covert healthService to URL, some services got a null meta variable, so NPE happens. I can solve it ASAP.

yes, I check meta=null

@Moriadry-zz
Copy link

@byronzoz sorry for the delay reply, I'm just waiting for my integration test to be reviewed. I am trying to add a consul sample for Dubbo, to fix this bug, and to ensure we can use consul-registry well. apache/dubbo-samples#73

@beiwei30
Copy link
Member

@byronzoz would you mind to take a look at my change #3931 which should solve this issue?

@byronzoz
Copy link
Author

I will check and give you a feedback later @beiwei30

@byronzoz
Copy link
Author

byronzoz commented Apr 26, 2019

@beiwei30 @moriadry NPE has been solved. It seems to have problems.

provider side: (service has started)

2019-04-26 14:27:11 main INFO org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:111):111  [DUBBO] The service ready on spring started. service: com.byronzoz.common.service.facade.SessionContentFacade, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:11 main WARN org.apache.dubbo.config.AbstractInterfaceConfig.checkMetadataReport(AbstractInterfaceConfig.java:226):226  [DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:22 main INFO org.apache.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:593):593  [DUBBO] Export dubbo service com.byronzoz.common.service.facade.SessionContentFacade to local registry, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:22 main INFO org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:537):537  [DUBBO] Export dubbo service com.byronzoz.common.service.facade.SessionContentFacade to url dubbo://3.0.1.130:20880/com.byronzoz.common.service.facade.SessionContentFacade?anyhost=true&application=provider&bean.name=com.byronzoz.common.service.facade.SessionContentFacade&bind.ip=3.0.1.130&bind.port=20880&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.SessionContentFacade&methods=sayHello&owner=byronzoz&pid=90822&qos.enable=false&register=true&release=2.7.1&revision=1.0&side=provider&timestamp=1556260041936, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:22 main INFO org.apache.dubbo.config.AbstractInterfaceConfig.checkMonitor(AbstractInterfaceConfig.java:198):198  [DUBBO] There's no valid monitor config found, if you want to open monitor statistics for Dubbo, please make sure your monitor is configured properly., dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:22 main INFO org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:547):547  [DUBBO] Register dubbo service com.byronzoz.common.service.facade.SessionContentFacade url dubbo://3.0.1.130:20880/com.byronzoz.common.service.facade.SessionContentFacade?anyhost=true&application=provider&bean.name=com.byronzoz.common.service.facade.SessionContentFacade&bind.ip=3.0.1.130&bind.port=20880&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.SessionContentFacade&methods=sayHello&owner=byronzoz&pid=90822&qos.enable=false&register=true&release=2.7.1&revision=1.0&side=provider&timestamp=1556260041936 to registry registry://10.100.12.2:8500/org.apache.dubbo.registry.RegistryService?application=provider&dubbo=2.0.2&owner=byronzoz&pid=90822&qos.enable=false&registry=consul&release=2.7.1&timestamp=1556260031916, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:22 main INFO org.apache.dubbo.qos.protocol.QosProtocolWrapper.startQosServer(QosProtocolWrapper.java:89):89  [DUBBO] qos won't be started because it is disabled. Please check dubbo.application.qos.enable is configured either in system property, dubbo.properties or XML/spring-boot configuration., dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:32 main INFO org.apache.dubbo.remoting.transport.AbstractServer.<init>(AbstractServer.java:65):65  [DUBBO] Start NettyServer bind /0.0.0.0:20880, export /3.0.1.130:20880, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:32 main INFO org.apache.dubbo.registry.support.AbstractRegistry.register(AbstractRegistry.java:261):261  [DUBBO] Register: dubbo://3.0.1.130:20880/com.byronzoz.common.service.facade.SessionContentFacade?anyhost=true&application=provider&bean.name=com.byronzoz.common.service.facade.SessionContentFacade&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.SessionContentFacade&methods=sayHello&owner=byronzoz&pid=90822&register=true&release=2.7.1&revision=1.0&side=provider&timestamp=1556260041936, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:27:32 main INFO org.apache.dubbo.container.Main.main(Main.java:90):90  [DUBBO] Dubbo SpringContainer started!, dubbo version: 2.7.1, current host: 3.0.1.130
[2019-04-26 14:27:32] Dubbo service server started!

server side: (also started)

2019-04-26 14:49:55 main INFO org.apache.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:111):111  [DUBBO] The service ready on spring started. service: com.byronzoz.common.service.facade.TestFacade, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:49:55 main WARN org.apache.dubbo.config.AbstractInterfaceConfig.checkMetadataReport(AbstractInterfaceConfig.java:226):226  [DUBBO] There's no valid metadata config found, if you are using the simplified mode of registry url, please make sure you have a metadata address configured properly., dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:06 main INFO org.apache.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:593):593  [DUBBO] Export dubbo service com.byronzoz.common.service.facade.TestFacade to local registry, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:06 main INFO org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:537):537  [DUBBO] Export dubbo service com.byronzoz.common.service.facade.TestFacade to url rest://3.0.1.130:8099/com.byronzoz.common.service.facade.TestFacade?anyhost=true&application=consumer&bean.name=com.byronzoz.common.service.facade.TestFacade&bind.ip=3.0.1.130&bind.port=8099&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.TestFacade&methods=call&owner=byronzoz&pid=96317&qos.enable=false&register=true&release=2.7.1&revision=1.0&server=tomcat&side=provider&timestamp=1556261405970, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:06 main INFO org.apache.dubbo.config.AbstractInterfaceConfig.checkMonitor(AbstractInterfaceConfig.java:198):198  [DUBBO] There's no valid monitor config found, if you want to open monitor statistics for Dubbo, please make sure your monitor is configured properly., dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:06 main INFO org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:547):547  [DUBBO] Register dubbo service com.byronzoz.common.service.facade.TestFacade url rest://3.0.1.130:8099/com.byronzoz.common.service.facade.TestFacade?anyhost=true&application=consumer&bean.name=com.byronzoz.common.service.facade.TestFacade&bind.ip=3.0.1.130&bind.port=8099&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.TestFacade&methods=call&owner=byronzoz&pid=96317&qos.enable=false&register=true&release=2.7.1&revision=1.0&server=tomcat&side=provider&timestamp=1556261405970 to registry registry://10.100.12.2:8500/org.apache.dubbo.registry.RegistryService?application=consumer&dubbo=2.0.2&owner=byronzoz&pid=96317&qos.enable=false&registry=consul&release=2.7.1&timestamp=1556261395943, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:06 main INFO org.apache.dubbo.qos.protocol.QosProtocolWrapper.startQosServer(QosProtocolWrapper.java:89):89  [DUBBO] qos won't be started because it is disabled. Please check dubbo.application.qos.enable is configured either in system property, dubbo.properties or XML/spring-boot configuration., dubbo version: 2.7.1, current host: 3.0.1.130
Apr 26, 2019 2:50:06 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8099"]
Apr 26, 2019 2:50:06 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 26, 2019 2:50:06 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
Apr 26, 2019 2:50:06 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.0.11
Apr 26, 2019 2:50:06 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-8099"]
2019-04-26 14:50:07 main INFO org.apache.dubbo.registry.support.AbstractRegistry.register(AbstractRegistry.java:261):261  [DUBBO] Register: rest://3.0.1.130:8099/com.byronzoz.common.service.facade.TestFacade?anyhost=true&application=consumer&bean.name=com.byronzoz.common.service.facade.TestFacade&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.TestFacade&methods=call&owner=byronzoz&pid=96317&register=true&release=2.7.1&revision=1.0&server=tomcat&side=provider&timestamp=1556261405970, dubbo version: 2.7.1, current host: 3.0.1.130
2019-04-26 14:50:07 main INFO org.apache.dubbo.container.Main.main(Main.java:90):90  [DUBBO] Dubbo SpringContainer started!, dubbo version: 2.7.1, current host: 3.0.1.130
[2019-04-26 14:50:07] Dubbo service server started!

but when call service from consumer side, throw RpcException as following:

@Test
@ContextConfiguration(locations = { "classpath*:META-INF/spring/*.xml" })
public class BasicTest extends AbstractTestNGSpringContextTests {

    @Autowired
    private TestFacade testFacade;

    @Test
    private void callTest() {
        testFacade.call("byronzoz");
    }

}
2019-04-26 14:53:34 main INFO org.apache.dubbo.registry.support.AbstractRegistry.register(AbstractRegistry.java:261):261  [DUBBO] Register: rest://3.0.1.130:8099/com.byronzoz.common.service.facade.TestFacade?anyhost=true&application=consumer&bean.name=com.byronzoz.common.service.facade.TestFacade&default.deprecated=false&default.dynamic=false&default.register=true&deprecated=false&dubbo=2.0.2&dynamic=false&generic=false&interface=com.byronzoz.common.service.facade.TestFacade&methods=call&owner=byronzoz&pid=97095&register=true&release=2.7.1&server=tomcat&side=provider&timestamp=1556261613848, dubbo version: 2.7.1, current host: 3.0.1.130  
2019-04-26 14:53:34 dubbo-consul-notifier-thread-1 WARN org.apache.dubbo.registry.support.AbstractRegistry.notify(AbstractRegistry.java:376):376  [DUBBO] Ignore empty notify urls for subscribe url consumer://3.0.1.130/com.byronzoz.common.service.facade.SessionContentFacade?application=consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=com.byronzoz.common.service.facade.SessionContentFacade&lazy=false&methods=sayHello&owner=byronzoz&pid=97095&qos.enable=false&release=2.7.1&revision=1.0&side=consumer&sticky=false&timestamp=1556261608006, dubbo version: 2.7.1, current host: 3.0.1.130  
FAILED: callTest
org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service com.byronzoz.common.service.facade.SessionContentFacade. No provider available for the service com.byronzoz.common.service.facade.SessionContentFacade from registry 10.100.12.2:8500 on the consumer 3.0.1.130 using the dubbo version 2.7.1. Please check if the providers have been started and registered.
	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:265)
	at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:57)
	at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:242)
	at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:76)
	at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57)
	at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java)
	at com.byronzoz.biz.service.impl.TestFacadeImpl.call(TestFacadeImpl.java:27)
	at com.byronzoz.test.BasicTest.callTest(BasicTest.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
	at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:182)
	at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:170)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:194)
	at org.testng.internal.Invoker.invokeMethod(Invoker.java:707)
	at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
	at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
	at org.testng.TestRunner.privateRun(TestRunner.java:767)
	at org.testng.TestRunner.run(TestRunner.java:617)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
	at org.testng.SuiteRunner.run(SuiteRunner.java:240)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1123)
	at org.testng.TestNG.run(TestNG.java:1031)
	at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
	at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
	at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

with ifconfig, I get some basic network info.

en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 88:e9:fe:88:ee:91
	inet 10.20.16.200 netmask 0xfffffc00 broadcast 10.20.19.255
	media: autoselect
	status: active
tun0: flags=8851<UP,POINTOPOINT,RUNNING,SIMPLEX,MULTICAST> mtu 1400
	inet 3.0.1.130 --> 3.0.1.130 netmask 0xffffffff
	open (pid 25598)

And the IP(3.0.1.130) is unreachable from localhost.

~$ ping 3.0.1.130
PING 3.0.1.130 (3.0.1.130): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1

[question]

No provider available for the service com.byronzoz.common.service.facade.SessionContentFacade from registry 10.100.12.2:8500 on the consumer 3.0.1.130 using the dubbo version 2.7.1. Please check if the providers have been started and registered.

It seems that the consumer side doesn't find the service from provider side. I found a phenomenon the service bind the ip to 3.0.1.130, rather than 10.20.16.200?

@beiwei30
Copy link
Member

beiwei30 commented May 6, 2019

It seems that the consumer side doesn't find the service from provider side. I found a phenomenon the service bind the ip to 3.0.1.130, rather than 10.20.16.200?

Yes, in this way, you have to specify IP explicitly to 10.20.16.200 associated to the network interface en0, by specifying -Dbind.ip=10.20.16.200

@beiwei30 beiwei30 closed this as completed May 6, 2019
@beiwei30 beiwei30 self-assigned this May 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants