Jaxb2Marshaller + packagesToScan + SpringMVC fails to find supported class [SPR-10551] #15182
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
status: backported
An issue that has been backported to maintenance branches
status: duplicate
A duplicate of another issue
Milestone
Michael Bazos opened SPR-10551 and commented
There seems to be an issue when you use the Jaxb2Marshaller + packagesToScan in conjunction with Spring MVC.
The issue I am specifically running into is that the method returns false even though the JAXBContext knows about the class:
public boolean supports(Class<?> clazz){...}
The issue is with the following method:
The problem is that even if the "packagesToScan" works...which it does the supportInternal method needs to check the current JAXBContext to see if that class is actually loaded. I checked and you cannot do this with JAXBContext so a better solution might be to add the class names to "classesToBeBound" as they are scanned in from the package scanner. After that then in the "supportsInternal" method an additional check can be made to see if the packages.
If you need me to attach code for the fix I would be more than happy to. Please just let me know as I am here to help. Also I didn't check the latest spring-oxm so I am not sure if this is no longer an issue but I couldn't find information on this in jira.
Affects: 3.1.1
Issue Links:
Backported to: 3.1.3
The text was updated successfully, but these errors were encountered: