Skip to content

Instantly share code, notes, and snippets.

@jamestrandung
Last active April 9, 2019 02:57
Show Gist options
  • Save jamestrandung/826b55e4b364bfe35265ade576543f77 to your computer and use it in GitHub Desktop.
Save jamestrandung/826b55e4b364bfe35265ade576543f77 to your computer and use it in GitHub Desktop.
Update javax.xml.bind.JAXBContextFactory to make use of packaged JAXB library
@SpringBootApplication
public class Application extends SpringBootServletInitializer {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
// Updating javax.xml.bind.JAXBContextFactory to make use of com.sun.xml.bind.v2.ContextFactory from our packaged WAR
System.setProperty("javax.xml.bind.JAXBContextFactory", "com.sun.xml.bind.v2.ContextFactory");
return application.sources(Application.class);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment