Porting SAAJ 1.4 changes from WSS4J
@@ -67,7 +67,19 @@ public final class DOMUtils {
static {
- if (JavaUtils.isJava9Compatible()) {
+ try {
+ Method[] methods = DOMUtils.class.getClassLoader().
+ loadClass("com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl").getMethods();
+ for (Method method : methods) {
+ if (method.getName().equals("register")) {
+ //this is the 1.4+ SAAJ impl
+ setJava9SAAJ(true);
+ break;
+ }
+ }
+ } catch (ClassNotFoundException cnfe) {
+ LogUtils.getL7dLogger(DOMUtils.class).finest(
+ "can't load class com.sun.xml.messaging.saaj.soap.SOAPDocumentImpl");
try {
Method[] methods = DOMUtils.class.getClassLoader().
@@ -79,11 +91,10 @@ public final class DOMUtils {
break;
}
}
- } catch (ClassNotFoundException cnfe) {
+ } catch (ClassNotFoundException cnfe1) {
LogUtils.getL7dLogger(DOMUtils.class).finest(
"can't load class com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl");
}
-
}
}
