1

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.

Avner Levy
  • 6,601
  • 9
  • 53
  • 92
  • possible duplicate of [How to use Moxy XPath annotated beans in web services?](http://stackoverflow.com/questions/13474816/how-to-use-moxy-xpath-annotated-beans-in-web-services) – bdoughan Nov 29 '12 at 18:26
  • Thanks for the link, but the link you provided discuss other implementations while my question is specifically on a CXF integration issue. In additional the idea of handling the xml directly (as suggested there) doesn't to me as a good direction. – Avner Levy Nov 29 '12 at 21:23
  • The problem is with JAX-WS (JSR-224) implementations having proprietary hooks into the JAXB (JSR-222) implementations they use for XML binding. The `Provider` mechanism is a standard JAX-WS mechanism to plug in your own binding solution which would allow you to leverage EclipseLink JAXB (MOXy). MOXy is supported by the JAX-WS implementations in WebLogic and GlassFish. – bdoughan Nov 29 '12 at 21:34
  • I'm working with Spring / CXF. It seems that CXF is using sun implementation hard coded. See code bellow: // fall back if we're using another jaxb implementation try { riContext = JAXBUtils.createRIContext(contextClasses .toArray(new Class[contextClasses.size()]), tns); } Can you provide more information how the Provide mechanism can help me as a user of CXF to override the above code? – Avner Levy Nov 29 '12 at 21:53
  • Is there any progress on this topic ? I'd also like to use CXF (jax-ws) with MOXY to make it work with JPA annotated classes. – JayBee Feb 21 '13 at 07:32
  • Not at the moment. It seems there nothing much to do beside rewrite the CXF code which use Sun's JAXB implementation. – Avner Levy Feb 22 '13 at 13:46
  • @JayBee see http://stackoverflow.com/questions/22295616/a-recommended-jax-ws-framework-for-working-with-moxy – Avner Levy Mar 11 '14 at 10:10

1 Answers1

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)

Daniel Kulp
  • 14,447
  • 4
  • 45
  • 37