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

Incompatible versions of jackson with other libraries #1327

Open
renancaju opened this issue Feb 17, 2021 · 4 comments
Open

Incompatible versions of jackson with other libraries #1327

renancaju opened this issue Feb 17, 2021 · 4 comments

Comments

@renancaju
Copy link

renancaju commented Feb 17, 2021

In the same project I have finch (0.32.1), zio-kafka (0.14.0) and awssdk (2.15.78), all of which depend on a different version of jackson. Digging the code up a little, I found out finch checks that the version it depends on (through finagle) is exactly the same version used in the build, otherwise it throws an exception on startup:

com.fasterxml.jackson.databind.JsonMappingException: Scala module 2.9.10 requires Jackson Databind version >= 2.9.0 and < 2.10.0

Is there a way to work around this? I don't quite grasp why finch has to check jackson's version, but is there a way to bypass this? Will a later finch release depending on a newer finagle fix this?

@sergeykolbasov
Copy link
Collaborator

sergeykolbasov commented Feb 17, 2021

It's coming from twitter-server of finagle-stats if I recall. I suggest to update those dependencies, Finch should work with newer Finagle just fine.

@rpless
Copy link
Collaborator

rpless commented Feb 18, 2021

Not quite (although twitter-server does use it a lot), Finagle uses jackson for ToggleMaps (which does get loaded by finagle-http). Finch does not use it directly so pinning to the version of Jackson that Finagle is using might work.

We're not directly checking the versions in Finch or Finagle. It happens inside jackson itself: https://github.com/FasterXML/jackson-module-scala/blob/5293009454ea7fbe37712de4e4191e1ebfd59c31/src/main/scala/com/fasterxml/jackson/module/scala/JacksonModule.scala#L53.
But it does stop Finagle servers from loading if that check fails, so its not ideal if other things are bringing another version in.

You might also be able to manually set a finagle version higher than what we use in that version of finch, although Finagle does not really have any binary compatibility guarantees.

@renancaju
Copy link
Author

So your recommendation would be to wait for the next Finch release, @rpless?
Is there a release planned for the near future?

@rpless
Copy link
Collaborator

rpless commented Feb 19, 2021

Its not ideal but that is a possible solution, I don't think we currently have an ETA on the next release.

Another option might be to try and downgrade the version of jackson-module-scala that you rely on to the version that Finagle is using. One way to do this would be with the dependencyOverrides directive in sbt. Even with that you may wind up with an issue with your other dependencies versions of jackson clashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants