-
Notifications
You must be signed in to change notification settings - Fork 81
jakarta.activation-api classpath collision with jakarta.activation #112
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
Comments
Let's see if mr Module, @GedMarc can help here... |
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) |
backwards compatibility considerations : Should i put this in the readme? |
@GedMarc Yes, I think a note on compatibility/work-arounds for README of jaxb-annotations module would make sense. |
So 2.0.0 came out last night - it's in the jakarta namespace - contains both sets in the base, and retains API with duplicate classes, I see PrimeFaces went the route of creating -jakarta artefacts with a shade to replace all javax. to jakarta. 1.2.2 module info, references the -api in the module declaration, it cannot be removed without a custom moditect, and you can't build JLink because it complains of packages found in two artefacts - I'm not sure if this can be resolved without customizing the base or waiting for the Jakarta guys So far, my only solution is to use a custom packaged that resolves this for them, until they are up and running, to modularize properly. It does not look like Jakarta 9 will be 100% JDK 11 compatible so far, Servlet 5 is in final and is not compatible, jakarta.mail is in final and is not compatible. EL 4.0 is in final and is also not compatible https://search.maven.org/artifact/com.guicedee.services/jakarta.activation |
Okay. Thank you for the research and clarification 👍 |
yes this is solved and pulled into 2.12.rc2 |
@aelgn Please check jdk11-compat test if you still have a problem and make issues there, this shouldn't come up at all if you use the |
@GedMarc I tried adding the dependency
Which unfortunately only aggravated the problem :) The
Which is interesting, since I don't have the |
ok so you need to make a choice then - but the change is successful 👍 if you want to use jakarta, then use jakarta - for annotation, activation, jaxb and jaxrs - :) otherwise you'll be creating the same issues all the time :) You can use the coordinates here in the jdk 11 test lib - https://github.com/FasterXML/jackson-jdk11-compat-test/blob/038942f1aec95fd3443fca7700bcb9852efb5dd8/pom.xml#L41 |
@GedMarc not sure I fully understand... Do you mean there is a choice in using
Do you mean by adding I can however get rid of the jakarta api artifacts by excluding them from
I guess I'm just wondering if that is a requirement for using jackson with other jakarta-based dependencies going forward? |
Wellllllll... If you put them into your dependency management section with the right versions, you won't need to exclude them ;) it will switch to the right jakarta version with that namespace :) What i meant was to use the dependency management feature to set the correct versions of everything to the jakarta namespace :) |
@GedMarc Aha! Thank you for bearing with me. This did indeed solve the problem 👍 🥇 For posterity:
|
The
jackson-module-jaxb-annotations
artifact pulls in thejakarta.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 tojakarta.activation
jakartaee/jaf-api#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?The text was updated successfully, but these errors were encountered: