Eclipse/OSGI, Java 11, JAXB, and the Classloader
问题 I have two Java modules, A and B. A provides a core model with JAXB annotations and helper classes for creating doing JAXB stuff (creating the context, marshalling, unmarshalling, etc.) B provides additional classes that are included in the model via @XmlAnyElement(lax = true) and must therefore be added to the JAXB context. This works fine in plain Java - B's classloader sees all the relevant classes and can instantiate the JAXB context with: JAXBContext.newInstance(RootFromA.class,