Configure CXF JAX-WS service to work with MOXY

天涯浪子 提交于 2019-12-20 04:50:26

问题


Although I've added a jaxb.properties with MOXY factory and I see that the JAXB was switched to moxy, CXF has a method named createRIContext in the JAXBUtils class which loads hard coded the sun JAXB implementation.
Is there a way to override it and use moxy instead? The problematic code is the following:

// fall back if we're using another jaxb implementation
try {
     riContext = JAXBUtils.createRIContext(contextClasses
               .toArray(new Class[contextClasses.size()]), tns);
}

It loads hard coded the "com.sun.xml.bind.v2.ContextFactory" class and use it to create a JAXB context.


回答1:


The 3.0.0-milestone2 version of CXF should handle Moxy quite a bit better. That said, there are still bugs in Moxy that have prevented all of the CXF unit and system tests to pass with it so we don't have the same level of confidence with Moxy as we do with the JAXB RI.

(any help with testing 3.0.0 would be greatly appreciated)



来源:https://stackoverflow.com/questions/13630539/configure-cxf-jax-ws-service-to-work-with-moxy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!