Leaking of jackson-databind dependency from vaadin-charts - any thoughts on

Hi All,

I’ve been evaluating the vaadin-charts components in my project (these work great btw.) when I hit an issue with the a"jackson-databind" dependency version mismatches. It would seem that the charts include this version:

com.fasterxml.jackson.core jackson-databind 2.5.2

In our project we use some other components such Apache Spark which requires this version to be “2.6.7.1”. If I run the Vaadin charts with this version I get:

java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonProperty$Access
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.findAccess(POJOPropertyBuilder.java:542)
at com.fasterxml.jackson.databind.introspect.POJOPropertyBuilder.removeNonVisible(POJOPropertyBuilder.java:623)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector._removeUnwantedAccessor(POJOPropertiesCollector.java:697)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.collectAll(POJOPropertiesCollector.java:298)
at com.fasterxml.jackson.databind.introspect.POJOPropertiesCollector.getJsonValueMethod(POJOPropertiesCollector.java:169)
at com.fasterxml.jackson.databind.introspect.BasicBeanDescription.findJsonValueMethod(BasicBeanDescription.java:223)
at com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByAnnotations(BasicSerializerFactory.java:348)
at com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:210)
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:1157)
at com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
at com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1387)
at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1088)
at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:960)
at com.vaadin.addon.charts.util.ChartSerialization.toJSON(ChartSerialization.java:110)
at com.vaadin.addon.charts.Chart.beforeClientResponse(Chart.java:436)
at com.vaadin.server.communication.UidlWriter.write(UidlWriter.java:126)
at com.vaadin.server.communication.UidlRequestHandler.writeUidl(UidlRequestHandler.java:124)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:92)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1601)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

Perhaps there are already plans to upgrade the Jackson version you depend on? Maybe even shading of these libraries could be an option?

Would appreciate your thoughts.

Regards,

Hi Jack,

Thanks for evaluating Vaadin Charts, I’m glad it works great in your project.
Please may I know the exact version of Vaadin Charts you’re using (as shown by mvn dependency:tree for example)?

Sure - currently I can see the dependency coming in here:

[INFO]
± com.vaadin:vaadin-charts:jar:4.0.5:compile
[INFO]
| - com.vaadin:vaadin-charts-model:jar:4.0.5:compile

Hopefully that is a recent enough version?
17355210.png

Great! Please try 4.1.0.beta1 which contains the [update to Jackson 2.9.5]
(https://github.com/vaadin/charts/pull/511/files#diff-2a35bd04bbd14a1b21ed3b64be51b08aL273).

You can browse the Charts release versions for Vaadin Framework 7 & 8 at https://github.com/vaadin/charts/releases and for Vaadin 10+ at https://github.com/vaadin/vaadin-charts-flow/releases

Thank you very much - I will try that out.