0

I have a complicated project, which has many dependencies on jackson-databind.

It was working well on Jersey 2.19.1

Recently I decided to upgrade Jersey to 2.40. Before to do this, I tried it in a small similar project, and it works well.

Then I updated on my main complicated project, and it complains ClassNotFoundException: com.fasterxml.jackson.databind.AnnotationIntrospector$XmlExtensions when the system is started.

I tried many days to figure out this issue and finally found the IDE found two versions of jackson-databind which AnnotationIntrospector stays in. One comes from Jersey, which is expected. But another one comes from logstash-logback-encoder, which is unexpected.

Dependency tree

Based on maven's rules, any conflict versions will be figured out to a final version. I knew those maven rules and how to use those rules.

But I didn't expect IDE will find another version. I ran this system in command line and had the same issue. So, it is not an IDE issue.

two versions of the library

After I updated logstash-logback-encoder version to match final Jackson-databind version, the issue disappears.

My question is: what is the root cause of this issue?

Justin
  • 1,050
  • 11
  • 26
  • Is there a question here? It sounds like you already solved your problem. – ZachOfAllTrades Jul 24 '23 at 19:08
  • My question is: What is the root cause of this issue? – Justin Jul 31 '23 at 13:44
  • Without seeing your pom file and project structure, it is not really possible to say for certain what the cause of the conflict was. Sometimes these things can happen from a faulty build process that does not properly clean a /lib directory, and you end up with two versions sitting there in your build output. – ZachOfAllTrades Aug 11 '23 at 21:50

0 Answers0