reta commented on a change in pull request #525: try to skip jaxb when not
available in jaxrs
URL: https://github.com/apache/cxf/pull/525#discussion_r266820508
##########
File path:
rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
##########
@@ -125,6 +130,19 @@
VALUE_CONTEXTS.add(Application.class.getName());
VALUE_CONTEXTS.add("javax.ws.rs.sse.Sse");
+
+ boolean useJaxb;
+ try {
+ ClassLoader loader =
Thread.currentThread().getContextClassLoader();
+ if (loader == null) {
+ loader = getSystemClassLoader();
+ }
+
loader.loadClass("javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter");
Review comment:
That's right, the classloader part (fe `ClassLoader loader =
Thread.currentThread().getContextClassLoader();`) may need to run as
privileged. That's basically what the `ClassLoaderUtils.loadClass` helps with,
thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services