Hi.
Mailing list resteasy-developers@lists.sourceforge.net was deprecated. I'm forwarding this to actual mailing list (resteasy-dev@lists.jboss.org).
Marek
Subject: | [Resteasy-developers] issue with restEasy client and jackson2 provider |
---|---|
Date: | Thu, 4 Aug 2016 17:39:26 +0000 |
From: | Mario Rodriguez <marodriguez@llbean.com> |
To: | resteasy-developers@lists.sourceforge.net <resteasy-developers@lists.sourceforge.net> |
Hi, I have a Java REST webservice that
connects to a Node.js REST service via restEasy client. While
I was using the old org.codehaus.jackson.* version it was
working fine, then I’m trying to update to jackson2 provider
but now I’m getting an error when the restEasy client on my
Java app is trying to post a message to the nodeJS service.
Exception in
thread "Thread-13" java.lang.NoSuchMethodErr
or:
com.fasterxml.jackson.databind.type.TypeFactory.constructType(Ljava/lang/refl
ect/Type;Ljava/lang/Class;)Lcom/fasterxml/jackson/databind/JavaType;
at
com.fasterxml.jackson.module.jaxb.JaxbAnnotati
onIntrospector._fullSerializationType(JaxbAnnotationIntrospector.java:1474)
at
com.fasterxml.jackson.module.jaxb.JaxbAnnotati
onIntrospector._findContentAdapter(JaxbAnnotationIntrospector.java:1410)
at
com.fasterxml.jackson.module.jaxb.JaxbAnnotati
onIntrospector.findSerializationContentConverter(JaxbAnnotationIntrospector.java:
800)
at
com.fasterxml.jackson.databind.introspect.Anno
tationIntrospectorPair.findSerializationContentConverter(AnnotationIntrospectorPa
ir.java:372)
at
com.fasterxml.jackson.databind.ser.std.StdSeri
alizer.findConvertingContentSerializer(StdSerializer.java:417)
at
com.fasterxml.jackson.databind.ser.std.AsArray
SerializerBase.createContextual(AsArraySerializerBase.java:198)
at
com.fasterxml.jackson.databind.SerializerProvi
der.handlePrimaryContextualization(SerializerProvider.java:928)
at
com.fasterxml.jackson.databind.SerializerProvi
der.findPrimaryPropertySerializer(SerializerProvider.java:626)
at
com.fasterxml.jackson.databind.ser.impl.Proper
tySerializerMap.findAndAddPrimarySerializer(PropertySerializerMap.java:72)
at
com.fasterxml.jackson.databind.ser.BeanPropert
yWriter._findAndAddDynamic(BeanPropertyWriter.java:834)
at
com.fasterxml.jackson.databind.ser.BeanPropert
yWriter.serializeAsField(BeanPropertyWriter.java:650)
at
com.fasterxml.jackson.databind.ser.std.BeanSer
ializerBase.serializeFields(BeanSerializerBase.java:678)
at
com.fasterxml.jackson.databind.ser.BeanSeriali
zer.serialize(BeanSerializer.java:157)
at
com.fasterxml.jackson.databind.ser.std.Collect
ionSerializer.serializeContents(CollectionSerializer.java:149)
at
com.fasterxml.jackson.databind.ser.std.Collect
ionSerializer.serialize(CollectionSerializer.java:112)
at
com.fasterxml.jackson.databind.ser.std.Collect
ionSerializer.serialize(CollectionSerializer.java:25)
at
com.fasterxml.jackson.databind.ser.DefaultSeri
alizerProvider.serializeValue(DefaultSerializerProvider.java:253)
at
com.fasterxml.jackson.databind.ObjectWriter$Pr
efetch.serialize(ObjectWriter.java:1425)
at
com.fasterxml.jackson.databind.ObjectWriter.wr
iteValue(ObjectWriter.java:930)
at
org.jboss.resteasy.plugins.providers.jackson.R
esteasyJackson2Provider.writeTo(ResteasyJackson2Provider.java:207)
at
org.jboss.resteasy.core.interception.AbstractW
riterInterceptorContext.writeTo(AbstractWriterInterceptorContext.java:131)
at
org.jboss.resteasy.core.interception.AbstractW
riterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:120)
at
org.jboss.resteasy.plugins.interceptors.encodi
ng.GZIPEncodingInterceptor.aroundWriteTo(GZIPEncodingInterceptor.java:100)
at
org.jboss.resteasy.core.interception.AbstractW
riterInterceptorContext.proceed(AbstractWriterInterceptorContext.java:124)
at
org.jboss.resteasy.client.jaxrs.internal.Clien
tInvocation.writeRequestBody(ClientInvocation.java:370)
at
org.jboss.resteasy.client.jaxrs.engines.Apache
HttpClient4Engine.writeRequestBodyToOutputStream(ApacheHttpClient4Engine.java:558
)
at
org.jboss.resteasy.client.jaxrs.engines.Apache
HttpClient4Engine.buildEntity(ApacheHttpClient4Engine.java:524)
at
org.jboss.resteasy.client.jaxrs.engines.Apache
HttpClient4Engine.loadHttpMethod(ApacheHttpClient4Engine.java:423)
at
org.jboss.resteasy.client.jaxrs.engines.Apache
HttpClient4Engine.invoke(ApacheHttpClient4Engine.java:281)
at
org.jboss.resteasy.client.jaxrs.internal.Clien
tInvocation.invoke(ClientInvocation.java:436)
at
org.jboss.resteasy.client.jaxrs.internal.proxy
.ClientInvoker.invoke(ClientInvoker.java:102)
at
org.jboss.resteasy.client.jaxrs.internal.proxy
.ClientProxy.invoke(ClientProxy.java:76)
at
com.sun.proxy.$Proxy56.saveOrders(Unknown Sour
ce)
at
com.llbean.order.history.extractor.writer.Serv
iceOrderWriter.writeOrders(ServiceOrderWriter.java:67)
at
com.llbean.order.history.extractor.migration.W
orker.execute(Worker.java:29)
at
com.llbean.order.history.extractor.migration.A
bstractExtractorTemplate.executeWorkers(AbstractExtractorTemplate.java:43)
at
com.llbean.order.history.extractor.migration.A
bstractExtractorTemplate.extract(AbstractExtractorTemplate.java:31)
at
com.llbean.order.history.extractor.rest.Initia
tionResource$1.run(InitiationResource.java:48)
at
java.lang.Thread.run(Thread.java:745)
I found this page http://stackoverflow.com/questions/21780208/resteasy-and-jackson-incompatibility-nosuchmethodexception
making reference to an incompatibility on earlier versions of
restEasy and jackson2, however, I’m using Jackson 2.7 and
restEasy 3.0.16.
Here is the gradle build settings:
//
RestEasy (Server side JAX-RS implementation)
compile
'org.jboss.resteasy:resteasy-jaxrs:3.0.16.Final'
compile
'org.jboss.resteasy:resteasy-guice:3.0.16.Final'
compile
'org.jboss.resteasy:resteasy-servlet-initializer:3.0.16.Final'
compile
'org.jboss.resteasy:resteasy-jackson2-provider:3.0.16.Final'
//
RESTEasy (JAX-RS client)
compile
'org.jboss.resteasy:resteasy-client:3.0.16.Final'
Any clue what I’m missing ?
Mario
Rodríguez
Systems
Analyst | Customer Technology Team | L.L.Bean Inc.
CR P: (506)
2201-0183 | US P: (207) 552-6677 ext. 40083