cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1081036 - /cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
Date Sun, 13 Mar 2011 03:04:12 GMT
Author: dkulp
Date: Sun Mar 13 03:04:12 2011
New Revision: 1081036

URL: http://svn.apache.org/viewvc?rev=1081036&view=rev
Log:
[CXF-3363] Add a couple guards around the soap 1.2 factory creations

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java?rev=1081036&r1=1081035&r2=1081036&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
Sun Mar 13 03:04:12 2011
@@ -46,7 +46,7 @@ public final class SAAJFactoryResolver {
         MessageFactory messageFactory;
         String messageFactoryClassName = System.getProperty(MESSAGE_FACTORY_KEY);
         if (messageFactoryClassName != null) {
-            messageFactory = newInstanceCxfMessageFactory(messageFactoryClassName,
+            messageFactory = newInstanceCxfSAAJFactory(messageFactoryClassName,
                                                           MessageFactory.class);
         } else if (version instanceof Soap11) {
             try {
@@ -55,7 +55,11 @@ public final class SAAJFactoryResolver {
                 messageFactory = MessageFactory.newInstance();
             }
         } else if (version instanceof Soap12) {
-            messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+            try {
+                messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+            } catch (Throwable t) {
+                messageFactory = MessageFactory.newInstance();
+            }
         } else {
             messageFactory = MessageFactory.newInstance();
         }
@@ -66,7 +70,7 @@ public final class SAAJFactoryResolver {
         SOAPFactory soapFactory;
         String soapFactoryClassName = System.getProperty(SOAP_FACTORY_KEY);
         if (soapFactoryClassName != null) {
-            soapFactory = newInstanceCxfMessageFactory(soapFactoryClassName,
+            soapFactory = newInstanceCxfSAAJFactory(soapFactoryClassName,
                                                        SOAPFactory.class);
         } else if (version instanceof Soap11) {
             try {
@@ -75,14 +79,18 @@ public final class SAAJFactoryResolver {
                 soapFactory = SOAPFactory.newInstance();
             }
         } else if (version instanceof Soap12) {
-            soapFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+            try {
+                soapFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+            } catch (Throwable t) {
+                soapFactory = SOAPFactory.newInstance();
+            }
         } else {
             soapFactory = SOAPFactory.newInstance();
         }
         return soapFactory;
     }
 
-    private static <T> T newInstanceCxfMessageFactory(String factoryName, Class<T>
cls)
+    private static <T> T newInstanceCxfSAAJFactory(String factoryName, Class<T>
cls)
         throws SOAPException {
         try {
             Class<?> klass = Class.forName(factoryName);



Mime
View raw message