question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

jakarta.activation-api classpath collision with jakarta.activation

See original GitHub issue

The jackson-module-jaxb-annotations artifact pulls in the jakarta.activation:jakarta.activation-api dependency.

This causes classpath collisions for the activation api classes that are also included in com.sun.activation:jakarta.activation if this artifact is also a (transitive or not) dependency.

Ie. in Jetty you will get this warning at startup: [WARNING] javax.activation.ActivationDataFlavor scanned from multiple locations: jar:file:///<snip>.m2/repository/com/sun/activation/jakarta.activation/1.2.1/jakarta.activation-1.2.1.jar!/javax/activation/ActivationDataFlavor.class, jar:file:///<snip>.m2/repository/jakarta/activation/jakarta.activation-api/1.2.1/jakarta.activation-api-1.2.1.jar!/javax/activation/ActivationDataFlavor.class

The fix in similar cases seems to be to change the jakarta.activation-api dependency to jakarta.activation https://github.com/eclipse-ee4j/jaf/issues/18 https://issues.apache.org/jira/browse/SPARK-27611

Is this in scope for jackson-module-jaxb-annotations or are users of the artifact meant to manually exclude/provide the activation api classes?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
GedMarccommented, Oct 23, 2020

Simple update to 1.2.2 on activation-api, removal of activation 😃

Please let me do this PR though, jaxb also has a funky thing on this (jaxrs base&impl)

0reactions
aelgncommented, Nov 17, 2020

@GedMarc Aha! Thank you for bearing with me. This did indeed solve the problem 👍 🥇

For posterity:

<dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.fasterxml.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>2.12.0-rc2</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>jakarta.activation</groupId>
        <artifactId>jakarta.activation-api</artifactId>
        <version>2.0.0</version>
      </dependency>
      <dependency>
        <groupId>jakarta.xml.bind</groupId>
        <artifactId>jakarta.xml.bind-api</artifactId>
        <version>3.0.0</version>
      </dependency>
    </dependencies>
  </dependencyManagement> 
Read more comments on GitHub >

github_iconTop Results From Across the Web

jakarta.activation-api : 2.1.0-RC1 - Maven Central
Jakarta Activation API - ${project.name} ${spec.version} Specification.
Read more >
Dependency resolution on pom file with jdk version activated ...
Hello, I came across an issue with dependency resolution. When dependencies are declared in pom inside profile block which is activated based on...
Read more >
KB-2215 How to update a custom plug-in using the JavaMail ...
In the project build.gradle file: Ensure that any javax.mail and javax.activation dependencies are removed. Add the jakarta.mail and jakarta.activation ...
Read more >
Jakarta Activation - Eclipse projects
Jakarta Activation ™ is a standard extension to the Java platform that lets you take advantage of standard services to: determine the type...
Read more >
vogella blog | Because knowledge feels like magic.
The following bundles need to be added to the product in order to make JAXB work with Java 11 in OSGi: jakarta.activation-api; jakarta.xml.bind- ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found