1

my websphere uses some IBM propertiary jaxb implementation which is not compatible with something I'm using. I included the one I'd like to use in the classpath but the application uses still the default one. I've read that I can change the implementation by:

  1. Creating a file called jaxb.properties where my domain jax-b annotated classes reside in which contains something like

    javax.xml.bind.context.factory=com.sun.xml.bind.v2.runtime.JAXBContextImpl

The problem with this approach is that those classes are outside the project I'm developing.

  1. Creating a file javax.xml.bind.JAXBContext just like in http://docs.oracle.com/javaee/6/api/javax/xml/bind/JAXBContext.html in Discovery of JAXB implementation chapter. The problem is I can't figure out what should be inside of it and have no easy way to test it. Can anyone tell me what standard service descriptor convention is? How this file should look like if I'd like to use com.sun.xml.bind.v2.runtime.JAXBContextImpl as the implementation of jaxb?

Thanks!

kboom
  • 2,279
  • 3
  • 28
  • 43

1 Answers1

1

The first option itself would do.

The problem with this approach is that those classes are outside the project I'm developing.

This is not a problem - even though the domain classes reside inside a library/ jar, you still can have the package structure + jaxb.properties created in the classpath. i.e. If it's a maven project, you can create this package structure in resources directory.

Fahim Farook
  • 1,482
  • 2
  • 14
  • 38