Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jackson version too old which lead to version conflict. #31097

Closed
counter2015 opened this issue Jan 29, 2022 · 1 comment
Closed

Jackson version too old which lead to version conflict. #31097

counter2015 opened this issue Jan 29, 2022 · 1 comment
Assignees
Milestone

Comments

@counter2015
Copy link

Now used jackson version is 2.11.4

val jacksonVersion = "2.11.4"

I'm using akka projection with many akka commponts, it will lead error to

╥
╠══╦══╗
║  ║  ║
║  ║  ╠─A checked error was not handled.
║  ║  ║ com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.11.4 requires Jackson Databind version >= 2.11.0 and < 2.12.0
║  ║  ║ 	at com.fasterxml.jackson.module.scala.JacksonModule.setupModule(JacksonModule.scala:61)
║  ║  ║ 	at com.fasterxml.jackson.module.scala.JacksonModule.setupModule$(JacksonModule.scala:46)
║  ║  ║ 	at com.fasterxml.jackson.module.scala.DefaultScalaModule.setupModule(DefaultScalaModule.scala:17)
║  ║  ║ 	at com.fasterxml.jackson.databind.ObjectMapper.registerModule(ObjectMapper.java:835)
║  ║  ║ 	at akka.serialization.jackson.JacksonObjectMapperProvider$.$anonfun$configureObjectMapperModules$4(JacksonObjectMapperProvider.scala:242)
║  ║  ║ 	at akka.serialization.jackson.JacksonObjectMapperProvider$.$anonfun$configureObjectMapperModules$4$adapted(JacksonObjectMapperProvider.scala:241)
║  ║  ║ 	at scala.collection.immutable.List.foreach(List.scala:333)

My Dependencies

object Versions {
    val akka = "2.6.18"
    val akkaManagement = "1.1.3"
    val akkaProjection = "1.2.3"
  }

val akka = Seq(
    "com.typesafe.akka" %% "akka-persistence"           % Versions.akka,
    "com.typesafe.akka" %% "akka-persistence-cassandra" % "1.0.5",
    "com.typesafe.akka" %% "akka-persistence-query"     % Versions.akka,
    "com.typesafe.akka" %% "akka-persistence-typed"     % Versions.akka,
    "com.typesafe.akka" %% "akka-persistence-testkit"   % Versions.akka % Test,
    "com.typesafe.akka" %% "akka-serialization-jackson" % Versions.akka
  )

  val akkaActor = Seq(
    "com.typesafe.akka" %% "akka-actor-typed"            % Versions.akka,
    "com.typesafe.akka" %% "akka-cluster-sharding-typed" % Versions.akka,
    "com.typesafe.akka" %% "akka-cluster-tools"          % Versions.akka,
    "com.typesafe.akka" %% "akka-discovery"              % Versions.akka
  )

  val akkaStream = Seq(
    "com.typesafe.akka" %% "akka-stream"       % Versions.akka,
    "com.typesafe.akka" %% "akka-stream-kafka" % "3.0.0"
  )

  val akkaManagement = Seq(
    "com.lightbend.akka.management" %% "akka-management-cluster-bootstrap" % Versions.akkaManagement,
    "com.lightbend.akka.discovery" %% "akka-discovery-kubernetes-api"      % Versions.akkaManagement
  )

  val akkaProjection = Seq(
    "com.lightbend.akka" %% "akka-projection-cassandra"     % Versions.akkaProjection,
    "com.lightbend.akka" %% "akka-projection-core"          % Versions.akkaProjection,
    "com.lightbend.akka" %% "akka-projection-durable-state" % Versions.akkaProjection,
    "com.lightbend.akka" %% "akka-projection-eventsourced"  % Versions.akkaProjection,
    "com.lightbend.akka" %% "akka-projection-kafka"         % Versions.akkaProjection,
    "com.lightbend.akka" %% "akka-projection-testkit"       % Versions.akkaProjection % Test
  )

And latest version is 2.13.1
https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core

Is scala-steward still works or there is other reason for stay jackson verison to 2.11.4?

How about update jackson dependcy to latest version ?

@raboof
Copy link
Member

raboof commented Jan 29, 2022

is other reason for stay jackson verison to 2.11.4

Yes: jackson changed between 2.11.4 and 2.13.1. While we don't rely on any of the parts that changed, so Akka works fine with 2.13.1, there could be projects using Akka that do rely on the 2.11 behavior. For that reason we're reluctant to update jackson in Akka, since that might force projects to also update, which might not be easy.

It's fine to update jackson in your project though. To fix the problem you're running into, make sure you also upgrade the "com.fasterxml.jackson.module" % "jackson-module-scala" dependency.

Let's keep this issue open until we have added a page to the docs describing this.

@patriknw patriknw added 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted help wanted Issues that the core team will likely not have time to work on t:docs t:serialization labels Jan 31, 2022
@patriknw patriknw added 3 - in progress Someone is working on this ticket and removed help wanted Issues that the core team will likely not have time to work on 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted labels Sep 15, 2022
@patriknw patriknw self-assigned this Sep 15, 2022
patriknw added a commit that referenced this issue Sep 15, 2022
patriknw added a commit that referenced this issue Sep 16, 2022
patriknw added a commit that referenced this issue Sep 16, 2022
* Update Jackson to 2.13.4, #31097

* note in migration guide
@patriknw patriknw removed the 3 - in progress Someone is working on this ticket label Sep 16, 2022
@patriknw patriknw added this to the 2.7.0-M2 milestone Sep 16, 2022
GreyPlane pushed a commit to GreyPlane/akka that referenced this issue Sep 17, 2022
* Update Jackson to 2.13.4, akka#31097

* note in migration guide
@patriknw patriknw modified the milestones: 2.7.0-M2, 2.7.0 Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants