How to specify a particular JAXB implementation?

前端 未结 2 1216
不知归路
不知归路 2020-12-13 20:21

It seems as though I have already done this once in the past, but I cannot find any reference to what I had done to get it to work.

I have a web application in which

相关标签:
2条回答
  • 2020-12-13 20:31

    Note: I'm the EclipseLink JAXB (MOXy) lead and a member of the JAXB 2 (JSR-222) expert group.

    To specify a JAXB (JSR-222) implementation other than the default you need to include a file called jaxb.properties in the same package as your domain classes. The following is an example of the jaxb.properties file used to specify the MOXy implementation of JAXB:

    javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory
    

    For More Information

    • http://blog.bdoughan.com/2011/05/specifying-eclipselink-moxy-as-your.html
    0 讨论(0)
  • 2020-12-13 20:53

    It is possible to load JAXB implementation from a specific library using the Java Endorsed Standards Override Mechanism. This is also suggested in the guide Using JAXB 2.1/2.2 with JavaSE 6.

    Alternatively, in your application server you may modify the class-loader policy for your application to parent last so that classes are first looked up in the libraries bundled with your application before being searched in JRE.

    0 讨论(0)
提交回复
热议问题