cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1519041 - in /cxf/branches/2.6.x-fixes: rt/core/ rt/core/src/main/java/org/apache/cxf/databinding/source/ rt/core/src/test/java/org/apache/cxf/bus/spring/ systests/jaxws/
Date Fri, 30 Aug 2013 18:15:08 GMT
Author: dkulp
Date: Fri Aug 30 18:15:07 2013
New Revision: 1519041

URL: http://svn.apache.org/r1519041
Log:
Merged revisions 1519036 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1519036 | dkulp | 2013-08-30 13:59:54 -0400 (Fri, 30 Aug 2013) | 2 lines

  On 2.7, we need to load the msv stuff dynamically as an extension. (matches what Aegis does)

........

Modified:
    cxf/branches/2.6.x-fixes/rt/core/pom.xml
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
    cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
    cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
    cxf/branches/2.6.x-fixes/systests/jaxws/pom.xml

Modified: cxf/branches/2.6.x-fixes/rt/core/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/pom.xml?rev=1519041&r1=1519040&r2=1519041&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/pom.xml (original)
+++ cxf/branches/2.6.x-fixes/rt/core/pom.xml Fri Aug 30 18:15:07 2013
@@ -75,11 +75,6 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-wstx-msv-validation</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
             <groupId>com.sun.xml.bind</groupId>
             <artifactId>jaxb-impl</artifactId>
         </dependency>

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties?rev=1519041&r1=1519040&r2=1519041&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/Messages.properties
Fri Aug 30 18:15:07 2013
@@ -22,4 +22,4 @@ COULD_NOT_READ_XML_STREAM = Could not pa
 COULD_NOT_WRITE_XML_STREAM = Could not generate the XML stream.
 COULD_NOT_READ_XML_STREAM_CAUSED_BY = Could not parse the XML stream caused by: {0}: {1}.
 COULD_NOT_WRITE_XML_STREAM_CAUSED_BY = Could not generate the XML stream caused by: {0}:
{1}.
-COULD_NOT_VALIDATE_XML_STREAM = Failed to initialize MSV validator and validate the XMLStream.
+COULD_NOT_VALIDATE_XML_STREAM = Failed to initialize MSV validator and validate the XMLStream.
 Make sure cxf-wstx-msv-validation and the MSV libraries are found.

Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java?rev=1519041&r1=1519040&r2=1519041&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/databinding/source/XMLStreamDataReader.java
Fri Aug 30 18:15:07 2013
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Collection;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.activation.DataSource;
@@ -44,6 +45,7 @@ import org.apache.cxf.common.util.String
 import org.apache.cxf.databinding.DataReader;
 import org.apache.cxf.interceptor.Fault;
 import org.apache.cxf.io.CachedOutputStream;
+import org.apache.cxf.io.StaxValidationManager;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.MessagePartInfo;
@@ -53,7 +55,6 @@ import org.apache.cxf.staxutils.StaxSour
 import org.apache.cxf.staxutils.StaxStreamFilter;
 import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.staxutils.W3CDOMStreamReader;
-import org.apache.cxf.wstx_msv_validation.WoodstoxValidationImpl;
 
 public class XMLStreamDataReader implements DataReader<XMLStreamReader> {
     private static final Logger LOG = LogUtils.getL7dLogger(XMLStreamDataReader.class);
@@ -210,18 +211,20 @@ public class XMLStreamDataReader impleme
         } else {
             rootElement = (Element)ds.getNode();
         }
-
-        //filter xop node
-        XMLStreamReader reader = StaxUtils.createXMLStreamReader(ds);
-        XMLStreamReader filteredReader = 
-            StaxUtils.createFilteredReader(reader, 
-                                           new StaxStreamFilter(new QName[] {XOP}));
-        
-        XMLStreamWriter nullWriter = StaxUtils.createXMLStreamWriter(new NUllOutputStream());
-        //TODO: expensive to create WoodstoxValidationImpl ?
-        WoodstoxValidationImpl impl = new WoodstoxValidationImpl(message.getExchange().getBus());
-        impl.setupValidation(nullWriter, message.getExchange().getService().getServiceInfos().get(0));
-        StaxUtils.copy(filteredReader, nullWriter);
+        StaxValidationManager svm = message.getExchange().getBus().getExtension(StaxValidationManager.class);
+        if (svm != null) {
+            //filter xop node
+            XMLStreamReader reader = StaxUtils.createXMLStreamReader(ds);
+            XMLStreamReader filteredReader = 
+                StaxUtils.createFilteredReader(reader, 
+                                               new StaxStreamFilter(new QName[] {XOP}));
+            
+            XMLStreamWriter nullWriter = StaxUtils.createXMLStreamWriter(new NUllOutputStream());
       
+            svm.setupValidation(nullWriter, message.getExchange().getService().getServiceInfos().get(0));
+            StaxUtils.copy(filteredReader, nullWriter);
+        } else {
+            LOG.log(Level.WARNING, "COULD_NOT_VALIDATE_XML_STREAM");
+        }
         return rootElement;        
     }
 

Modified: cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java?rev=1519041&r1=1519040&r2=1519041&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/core/src/test/java/org/apache/cxf/bus/spring/BusApplicationContextTest.java
Fri Aug 30 18:15:07 2013
@@ -40,6 +40,6 @@ public class BusApplicationContextTest e
         ctx = new BusApplicationContext(cfgFile, false);
         assertEquals("Unexpected number of resources", 1, ctx.getConfigResources().length);
         ctx = new BusApplicationContext(cfgFile, true);
-        assertEquals("Unexpected number of resources", 3, ctx.getConfigResources().length);
+        assertEquals("Unexpected number of resources", 2, ctx.getConfigResources().length);
     }
 }

Modified: cxf/branches/2.6.x-fixes/systests/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/jaxws/pom.xml?rev=1519041&r1=1519040&r2=1519041&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/jaxws/pom.xml (original)
+++ cxf/branches/2.6.x-fixes/systests/jaxws/pom.xml Fri Aug 30 18:15:07 2013
@@ -111,6 +111,11 @@
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-wstx-msv-validation</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-bindings-soap</artifactId>
             <version>${project.version}</version>
         </dependency>



Mime
View raw message