You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2019/03/19 02:20:43 UTC

[GitHub] [cxf] reta commented on a change in pull request #525: try to skip jaxb when not available in jaxrs

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_r266709508
 
 

 ##########
 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:
   You may better use `ClassLoaderUtils.loadClass("javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter", InjectionUtils.class)` since it properly handles the presence of the `SecurityManager`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services