I'm using MOXy under fuse ESB (based on karaf). When trying to create new instance of JAXBContext i get error : property "eclipselink-oxm-xml" is not supported.
I have placed jaxb.properties file with content : javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory in same package as domain classes. And xml-bindings file is loaded succesfully.
Map<String, Object> properties = new Hashmap<>(1);
properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, Utils.class.getResource("xml-bindings.xml").getPath());
JAXBContext jc = JAXBContext.newInstance(clazz, properties);
The main problem is that, when i run the function which uses this xml-bindings.xml properties from eclipse with JUnit tests, everything works fine, but when i run it in OSGi environment and call this function, i receive error : property "eclipselink-oxm-xml" is not supported.
So maybe somebody could give me the clue, what is wrong, why it fails to create new jaxbcontext in OSGi?
EDIT: System.getProperty("javax.xml.bind.context.factory") returns org.eclipse.persistance.jaxb.JAXBContextFactory, so i guess jaxb properties file is loaded.