-
Notifications
You must be signed in to change notification settings - Fork 46
Description
If I try to override the JAXBContextFactory implementation through JAXBContext.newInstance(java.lang.String,java.lang.ClassLoader,java.util.Map), using a map like Map.of(JAXBContext.JAXB_CONTEXT_FACTORY, "org.glassfish.jaxb.runtime.v2.JAXBContextFactory"), for example, it throws an exception:
<...>
Caused by: jakarta.xml.bind.JAXBException: property "jakarta.xml.bind.JAXBContextFactory" is not supported
<...>
The variant JAXBContext.newInstance(java.lang.Class[],java.util.Map) works fine (see: 4f2ab0e).
According to the documentation (https://jakarta.ee/specifications/platform/10/apidocs/jakarta/xml/bind/jaxbcontext), it should work on both (?):
If the property JAXB_CONTEXT_FACTORY exists in the Map<String, ?> passed to newInstance(Class[], Map) or to newInstance(String, ClassLoader, Map), then its value is assumed to be the fully qualified provider factory class name. This phase of the look up enables context sensitive selection of the Jakarta XML Binding implementation.