jurmous / etcd4j

Java / Netty client for etcd, the highly-available key value store for shared configuration and service discovery.
Apache License 2.0
267 stars 83 forks source link

Error: mousio.etcd4j.EtcdClient.<init>(Ljava/lang/String;Ljava/lang/String;[Ljava/net/URI;)V #156

Closed regardfs closed 7 years ago

regardfs commented 7 years ago
Error log:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'etcdClient' defined in class path resource 
[EtcdAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [mousio.etcd4j.EtcdClient]: Factory method 'etcdClient' threw exception; nested exception is java.lang.NoSuchMethodError: mousio.etcd4j.EtcdClient.<init>(Ljava/lang/String;Ljava/lang/String;[Ljava/net/URI;)V

And I create etcdClient with these Code

 EtcdClient etcdClient =  new EtcdClient("aaa", "aaa123", "http://192.168.66.1:2379", "http://192.168.66.2:2379")

I could not figure out why this happen...

lburgazzoli commented 7 years ago

Looks like you are mixing up uri and strings which is not supported. can you share the relevant code ?

regardfs commented 7 years ago

@lburgazzoli Hi, I found the reason, I write this etcd-config lib and used by other project which have different spring-cloud-dependencies. I change them and It is ok now