-
Notifications
You must be signed in to change notification settings - Fork 38.5k
XML request body cannot be deserialised by Spring web 5 with javax.xml.bind.annotation #25273
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
What version of Java are you running your application on? Java 9 made some changes around JAX-B so that some classes are no longer available by default. There's some information about this in the Spring Boot wiki. If you don't think the above applies here then I'm not sure what the problem may be. It's hard to tell from what you've shared thus far. If you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. |
Hello, Thanks for your quick reply. I forked a simple Spring mvc demo and created a simple controller to reproduce the problem . Here is my test case branche https://github.com/quancheng-zhao/spring-mvc-showcase/pull/1/files. ResourceController.java has two xml consumed api. /test/javax uses javax dto. /test/fasterxml uses jackson xml dto. Controller will print whether values are null or not. Here is the printed result on my local, values deserialised by javax are null. ======= javax header is not null I hope this sample will help. Thank you. |
Thanks. The Spring MVC Showcase doesn't use Spring Boot. I'll ask the Spring Framework team to take a look. |
Hello, when upgrading SpringBoot from 1.x to 2.x, Restful apis which consumes xml as request body are broken because values are deserialised to null.
API is like:
XmlRequest
used javax.xml.bind.annotation. Then I changed annotation to jackson-dataformat-xml, request body can be deserialised as before.I don't find any report about javax xml problem. Does SpringBoot 2 have some limitation to use this package? Should XML deserialisation use jackson xml databinding? When I refactored the code, I find out jackson xml databing has less annotation and it works not well with polymorphic subtypes.
Thanks for your help.
The text was updated successfully, but these errors were encountered: