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

"MessageBodyWriter not found for media type=application/xml" error preventing upgrade from 2.32 to 2.33 #5670

Closed
jluehe opened this issue Jun 3, 2024 · 7 comments

Comments

@jluehe
Copy link

jluehe commented Jun 3, 2024

We are currently running with Jersey 2.32 and trying to upgrade to latest version. However, trying to upgrade to 2.33 already gives an error:

org.glassfish.jersey.message.internal.WriterInterceptorExecutor[] [...] MessageBodyWriter not found for media type=application/xml, type=class test.framework.common.pojos.TestResults, genericType=class test.framework.common.pojos.TestResults.

I have looked at the delta between versions 2.32 and 2.33 (2.32...2.33), but don't see anything obvious that could be causing this error.

There are no other changes.

Any ideas?

@senivam
Copy link
Contributor

senivam commented Jun 4, 2024

Do you have

             <groupId>org.glassfish.jersey.media</groupId>
             <artifactId>jersey-media-jaxb</artifactId>

dependency in your classpath? If you use JDK 11+ there should be also

            <groupId>jakarta.xml.bind</groupId>
            <artifactId>jakarta.xml.bind-api</artifactId>

,

           <groupId>com.sun.xml.bind</groupId>
           <artifactId>jaxb-osgi</artifactId>

dependencies.

@jluehe
Copy link
Author

jluehe commented Jun 4, 2024

Thank you, @senivam, for your reply!

Yes, I do have the following (we are using JDK 17):

  • javax.xml.bind:jaxb-api:2.3.0
  • org.glassfish.jersey.media:jersey-media-jaxb:2.32

I do not have com.sun.xml.bind:jaxb-osgi though. Is it required? As I said, everything works fine with 2.32, it is only when I upgrade to 2.33 that I get the error ...

@senivam
Copy link
Contributor

senivam commented Jun 5, 2024

I hope, in reality, you have
org.glassfish.jersey.media:jersey-media-jaxb:2.33
not 2.32 as is the previous version you are migrating from.

could you please supply the output of the mvn dependency:tree for the module you are having error with?

@jluehe
Copy link
Author

jluehe commented Jun 5, 2024

I am upgrading all Jersey artifacts at the same time, so yes, as part of the upgrade, I am bumping org.glassfish.jersey.media:jersey-media-jaxb to 2.33 as well.

Will supply the dependency tree shortly ...

@jansupol
Copy link
Contributor

@jluehe I assume this is solved and can be closed?

@jluehe
Copy link
Author

jluehe commented Jul 25, 2024

Thanks for getting back to me, @jansupol! So far I have not been able to resolve the issue, but have not had time to look into it further ...

@jluehe
Copy link
Author

jluehe commented Aug 5, 2024

@jansupol, actually, this is fixed now. Turns out org.glassfish.jersey.media:jersey-media-jaxb was missing from the class path. Thanks for your help!

@jluehe jluehe closed this as completed Aug 5, 2024
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