cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1081448 - in /cxf/branches/2.3.x-fixes: ./ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
Date Mon, 14 Mar 2011 16:28:48 GMT
Author: dkulp
Date: Mon Mar 14 16:28:48 2011
New Revision: 1081448

URL: http://svn.apache.org/viewvc?rev=1081448&view=rev
Log:
Merged revisions 1081036 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1081036 | dkulp | 2011-03-12 22:04:12 -0500 (Sat, 12 Mar 2011) | 1 line
  
  [CXF-3363] Add a couple guards around the soap 1.2 factory creations
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java?rev=1081448&r1=1081447&r2=1081448&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJFactoryResolver.java
Mon Mar 14 16:28:48 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