using DefaultScalaModule

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

using DefaultScalaModule

Debasish Ghosh
Hello -

Flink 1.11 uses a shaded version of Jackson for serialization, which does not support jackson-module-scala. I need to register DefaultScalaModule for some Scala object serialization through Jackson. But when I do a mapper.registerModule(DefaultScalaModule), I get the following compilation error ..

type mismatch;
found   : com.fasterxml.jackson.module.scala.DefaultScalaModule.type
required: org.apache.flink.kubernetes.shaded.com.fasterxml.jackson.databind.Module

Any way how I can fix this ?

regards.
--
Reply | Threaded
Open this post in threaded view
|

Re: using DefaultScalaModule

Arvid Heise-3
Hi Debasish,

The idea of shading is actually to hide the dependencies of Flink from the user, such that he can use his own dependencies with appropriate versions.

That means, you add jackson with jackson-module-scala into your application jar without worrying about Flink's jackson at all (just treat it as an implementation detail).

On Tue, Dec 22, 2020 at 12:53 PM Debasish Ghosh <[hidden email]> wrote:
Hello -

Flink 1.11 uses a shaded version of Jackson for serialization, which does not support jackson-module-scala. I need to register DefaultScalaModule for some Scala object serialization through Jackson. But when I do a mapper.registerModule(DefaultScalaModule), I get the following compilation error ..

type mismatch;
found   : com.fasterxml.jackson.module.scala.DefaultScalaModule.type
required: org.apache.flink.kubernetes.shaded.com.fasterxml.jackson.databind.Module

Any way how I can fix this ?

regards.
--


--

Arvid Heise | Senior Java Developer


Follow us @VervericaData

--

Join Flink Forward - The Apache Flink Conference

Stream Processing | Event Driven | Real Time

--

Ververica GmbH | Invalidenstrasse 115, 10115 Berlin, Germany

--

Ververica GmbH
Registered at Amtsgericht Charlottenburg: HRB 158244 B
Managing Directors: Timothy Alexander Steinert, Yip Park Tung Jason, Ji (Toni) Cheng