You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
It looks like consul client 0.14.0 is using the wrong version of jackson-datatype-guava.
When i execute
@TestpublicvoidtestServiceRegistration() throwsException {
finalConsulconsul = Consul.builder().build(); // connect to Consul on localhostfinalAgentClientagentClient = consul.agentClient();
finalStringserviceName = "MyService";
finalStringserviceId = "1";
agentClient.register(8080, 3L, serviceName, serviceId);
}
I get the following exception:
java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.type.ReferenceType.upgradeFrom(Lcom/fasterxml/jackson/databind/JavaType;Lcom/fasterxml/jackson/databind/JavaType;)Lcom/fasterxml/jackson/databind/type/ReferenceType;
at com.fasterxml.jackson.datatype.guava.GuavaTypeModifier.modifyType(GuavaTypeModifier.java:44)
at com.fasterxml.jackson.databind.type.TypeFactory._constructType(TypeFactory.java:525)
at com.fasterxml.jackson.databind.type.TypeFactory.constructType(TypeFactory.java:470)
at com.fasterxml.jackson.databind.cfg.MapperConfig.constructType(MapperConfig.java:280)
at com.fasterxml.jackson.databind.cfg.MapperConfig.introspectClassAnnotations(MapperConfig.java:310)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.removeIgnorableTypes(BeanSerializerFactory.java:674)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanProperties(BeanSerializerFactory.java:545)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.constructBeanSerializer(BeanSerializerFactory.java:361)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.findBeanSerializer(BeanSerializerFactory.java:272)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:225)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
at com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
at com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1176)
at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:517)
at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:724)
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.forRootType(ObjectWriter.java:1349)
at com.fasterxml.jackson.databind.ObjectWriter.<init>(ObjectWriter.java:109)
at com.fasterxml.jackson.databind.ObjectMapper._newWriter(ObjectMapper.java:654)
at com.fasterxml.jackson.databind.ObjectMapper.writerWithType(ObjectMapper.java:3161)
at retrofit2.converter.jackson.JacksonConverterFactory.requestBodyConverter(JacksonConverterFactory.java:67)
at retrofit2.Retrofit.nextRequestBodyConverter(Retrofit.java:277)
at retrofit2.Retrofit.requestBodyConverter(Retrofit.java:258)
at retrofit2.ServiceMethod$Builder.parseParameterAnnotation(ServiceMethod.java:678)
at retrofit2.ServiceMethod$Builder.parseParameter(ServiceMethod.java:333)
at retrofit2.ServiceMethod$Builder.build(ServiceMethod.java:202)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:166)
at retrofit2.Retrofit$1.invoke(Retrofit.java:145)
at com.orbitz.consul.$Proxy9.register(Unknown Source)
at com.orbitz.consul.AgentClient.register(AgentClient.java:180)
at com.orbitz.consul.AgentClient.register(AgentClient.java:184)
at com.orbitz.consul.AgentClient.register(AgentClient.java:147)
at com.orbitz.consul.AgentClient.register(AgentClient.java:80)
at com.mytest.consul.connection.ServiceClientTest.test2(ServiceClientTest.java:109)
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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at org.mockito.internal.junit.JUnitRule$1.evaluate(JUnitRule.java:16)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:237)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
It looks like consul client 0.14.0 is using the wrong version of jackson-datatype-guava.
When i execute
I get the following exception:
This solved the problem for me:
See also:
FasterXML/jackson-datatype-guava#78
The text was updated successfully, but these errors were encountered: