Moxy error with Karaf

后端 未结 2 442
忘掉有多难
忘掉有多难 2020-12-07 03:08

I\'m using MOXy under fuse ESB (based on karaf), I converted org.eclipse.persistence.jar to a bundle, I deployed this bundle under fuse ESB and I got this error

2条回答
  •  再見小時候
    2020-12-07 03:41

    the problem has been solved by replacing this piece of code

    Map metadataSourceMap = new HashMap();      
    InputStream is = getClass().getClassLoader().getResourceAsStream("com/syngenta/mint/security/service/transformation/User.xml");               metadataSourceMap.put("com.syngenta.mint.security.model",new StreamSource(is));
    Map properties = new HashMap();
    properties.put(JAXBContextFactory.ECLIPSELINK_OXM_XML_KEY,metadataSourceMap);
            properties.put("javax.xml.bind.context.factory","org.eclipse.persistence.jaxb.JAXBContextFactory");
    

    With

    InputStream is = getClass().getClassLoader().getResourceAsStream("com/syngenta/mint/security/service/transformation/User.xml");    
    Map properties = new HashMap();
    properties.put(JAXBContextProperties.OXM_METADATA_SOURCE, is);
    

提交回复
热议问题