Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Issue connecting to remote consul endpoint #91

Closed
sashkachan opened this issue Jan 5, 2016 · 5 comments
Closed

Issue connecting to remote consul endpoint #91

sashkachan opened this issue Jan 5, 2016 · 5 comments

Comments

@sashkachan
Copy link

Consul is located at: http://172.17.0.77:8500

I set up the Consul with:

consul = Consul.builder().withUrl("http://172.17.0.77:8500").build();

I get an exception thrown:

SEVERE: java.lang.NullPointerException : null
com.orbitz.consul.ConsulException: Error connecting to Consul
    at com.orbitz.consul.AgentClient.ping(AgentClient.java:76)
    at com.orbitz.consul.Consul.<init>(Consul.java:64)
    at com.orbitz.consul.Consul.<init>(Consul.java:21)
    at com.orbitz.consul.Consul$Builder.build(Consul.java:328)
    at org.apache.mesos.elasticsearch.executor.mesos.ElasticsearchExecutor.createConsul(ElasticsearchExecutor.java:158)
    at org.apache.mesos.elasticsearch.executor.mesos.ElasticsearchExecutor.launchTask(ElasticsearchExecutor.java:75)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean.createWebClient(JAXRSClientFactoryBean.java:233)
    at org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.initTargetClientIfNeeded(ClientImpl.java:277)
    at org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.request(ClientImpl.java:238)
    at com.orbitz.consul.AgentClient.ping(AgentClient.java:68)
    ... 5 more

Not sure if webTarget is null?
I used gradle dependencies from the readme file.

    compile 'com.orbitz.consul:consul-client:0.9.15'
    // include your preferred javax.ws.rs-api implementation, for example:
    compile 'org.apache.cxf:cxf-rt-rs-client:3.0.3'
    compile 'org.apache.cxf:cxf-rt-transports-http-hc:3.0.3'

Thanks!

@rickfast
Copy link
Owner

rickfast commented Jan 5, 2016

I'm having a hard time reproducing. Let me dig around in the CXF code and see if I can figure out what is causing this.

Do you have any other JAX-RS implementations on the classpath?

@rickfast
Copy link
Owner

rickfast commented Jan 5, 2016

I just tried this with the same cxf version using withUrl

Consul client = Consul.builder().withUrl("http://192.168.99.100:8500").build();
Agent agent = client.agentClient().getAgent();

@rickfast
Copy link
Owner

rickfast commented Jan 5, 2016

I just released 0.9.16. Try that and let me know if you still have problems

@sashkachan
Copy link
Author

Thanks for the quick feedback.
I did a test run on an empty project and could successfully connect to the endpoint.
Something with my code. I will close for now. Thank you.

@zborisha
Copy link

zborisha commented Feb 9, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants