You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2014/06/13 17:29:35 UTC

[1/5] git commit: Optimization to only load the first extension found when only one is asked for.

Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 41e11d892 -> ec3deed2b


Optimization to only load the first extension found when only one is asked for.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/22e6b39d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/22e6b39d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/22e6b39d

Branch: refs/heads/2.7.x-fixes
Commit: 22e6b39db88ab99c175ba59bbcf623830614d1d1
Parents: 41e11d8
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Jun 12 12:37:26 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jun 13 11:04:20 2014 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/bus/CXFBusImpl.java     | 17 +++++++----
 .../cxf/bus/extension/ExtensionManagerImpl.java | 30 +++++++++++++++-----
 2 files changed, 34 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/22e6b39d/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java b/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
index 3f7583c..e578300 100644
--- a/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
+++ b/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
@@ -104,14 +104,19 @@ public class CXFBusImpl extends AbstractBasicInterceptorProvider implements Bus
                 loc = createConfiguredBeanLocator();
             }
             if (loc != null) {
-                //force loading
-                Collection<?> objs = loc.getBeansOfType(extensionType);
-                if (objs != null) {
-                    for (Object o : objs) {
-                        extensions.put(extensionType, o);
+                obj = loc.getBeanOfType(extensionType.getName(), extensionType);
+                if (obj != null) {
+                    extensions.put(extensionType, obj);
+                } else {
+                    //force loading
+                    Collection<?> objs = loc.getBeansOfType(extensionType);
+                    if (objs != null) {
+                        for (Object o : objs) {
+                            extensions.put(extensionType, o);
+                        }
                     }
+                    obj = extensions.get(extensionType);
                 }
-                obj = extensions.get(extensionType);
             }
         }
         if (null != obj) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/22e6b39d/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java b/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
index 33d8c47..4b014e1 100644
--- a/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
+++ b/rt/core/src/main/java/org/apache/cxf/bus/extension/ExtensionManagerImpl.java
@@ -188,7 +188,9 @@ public class ExtensionManagerImpl implements ExtensionManager, ConfiguredBeanLoc
                     if (loader != l) {
                         e.classloader = l;
                     }
-                    all.put(e.getName(), e);
+                    if (!all.containsKey(e.getName())) {
+                        all.put(e.getName(), e);
+                    }
                 }
             } finally {
                 try {
@@ -327,17 +329,31 @@ public class ExtensionManagerImpl implements ExtensionManager, ConfiguredBeanLoc
     }
     public <T> Collection<? extends T> getBeansOfType(Class<T> type) {
         List<T> ret = new LinkedList<T>();
-        for (Extension ex : all.values()) {
-            synchronized (ex) {
-                Class<?> cls = ex.getClassObject(loader);
+        Extension ext = all.get(type.getName());
+        if (ext != null) {
+            synchronized (ext) {
+                Class<?> cls = ext.getClassObject(loader);
                 if (cls != null && type.isAssignableFrom(cls)) {
-                    if (ex.getLoadedObject() == null) {
-                        loadAndRegister(ex);
+                    if (ext.getLoadedObject() == null) {
+                        loadAndRegister(ext);
                     }
-                    ret.add(type.cast(ex.getLoadedObject()));
+                    ret.add(type.cast(ext.getLoadedObject()));
                 }                
             }
         }
+        for (Extension ex : all.values()) {
+            if (ex != ext) {
+                synchronized (ex) {
+                    Class<?> cls = ex.getClassObject(loader);
+                    if (cls != null && type.isAssignableFrom(cls)) {
+                        if (ex.getLoadedObject() == null) {
+                            loadAndRegister(ex);
+                        }
+                        ret.add(type.cast(ex.getLoadedObject()));
+                    }                
+                }
+            }
+        }
         return ret;
     }
     public <T> boolean loadBeansOfType(Class<T> type, BeanLoaderListener<T> listener) {


[3/5] git commit: [CXF-5765] Fix several issues with RPC/Lit with schema validation turned on.

Posted by dk...@apache.org.
[CXF-5765] Fix several issues with RPC/Lit with schema validation turned on.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/d1e26dbf
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d1e26dbf
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d1e26dbf

Branch: refs/heads/2.7.x-fixes
Commit: d1e26dbf40290f7bd99b43f223b346b55f9c8db1
Parents: 5d717ee
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Jun 13 10:37:01 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jun 13 11:05:13 2014 -0400

----------------------------------------------------------------------
 .../AbstractInDatabindingInterceptor.java       |  2 +-
 .../AbstractOutDatabindingInterceptor.java      | 52 ++++++++++++++------
 .../cxf/staxutils/CachingXmlEventWriter.java    |  2 +-
 .../soap/interceptor/RPCInInterceptor.java      |  3 ++
 .../soap/interceptor/RPCOutInterceptor.java     | 34 ++++++++++++-
 .../JavaFirstSchemaValidationTest.java          | 35 +++++++++++--
 .../schemavalidation/PersonServiceRPC.java      | 45 +++++++++++++++++
 .../schemavalidation/PersonServiceRPCImpl.java  | 47 ++++++++++++++++++
 .../jaxws/schemavalidation/package-info.java    | 21 ++++++++
 9 files changed, 218 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/api/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java b/api/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
index 0fd9647..c47417a 100644
--- a/api/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
+++ b/api/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
@@ -135,7 +135,7 @@ public abstract class AbstractInDatabindingInterceptor extends AbstractPhaseInte
      * @param reader
      * @see #setDataReaderValidation(Service, Message, DataReader)
      */
-    private void setOperationSchemaValidation(OperationInfo opInfo, Message message) {
+    protected void setOperationSchemaValidation(OperationInfo opInfo, Message message) {
         if (opInfo != null) {
             SchemaValidationType validationType = 
                 (SchemaValidationType) opInfo.getProperty(Message.SCHEMA_VALIDATION_ENABLED);

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/api/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java b/api/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
index ee2b085..db3ba6c 100644
--- a/api/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
+++ b/api/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import javax.xml.namespace.NamespaceContext;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 import javax.xml.stream.events.XMLEvent;
@@ -62,6 +63,17 @@ public abstract class AbstractOutDatabindingInterceptor extends AbstractPhaseInt
     protected boolean isRequestor(Message message) {
         return Boolean.TRUE.equals(message.containsKey(Message.REQUESTOR_ROLE));
     }
+    protected boolean shouldBuffer(Message message) {
+        Object en = message.getContextualProperty(OUT_BUFFERING);
+        boolean allowBuffer = true;
+        boolean buffer = false;
+        if (en != null) {
+            buffer = Boolean.TRUE.equals(en) || "true".equals(en);
+            allowBuffer = !(Boolean.FALSE.equals(en) || "false".equals(en));
+        }
+        // need to cache the events in case validation fails or buffering is enabled
+        return buffer || (allowBuffer && shouldValidate(message) && !isRequestor(message));
+    }
     
     protected void writeParts(Message message, Exchange exchange, 
                               BindingOperationInfo operation, MessageContentsList objs, 
@@ -75,22 +87,17 @@ public abstract class AbstractOutDatabindingInterceptor extends AbstractPhaseInt
         // configure endpoint and operation level schema validation
         setOperationSchemaValidation(operation.getOperationInfo(), message);
         
-        Object en = message.getContextualProperty(OUT_BUFFERING);
-        boolean allowBuffer = true;
-        boolean buffer = false;
-        if (en != null) {
-            buffer = Boolean.TRUE.equals(en) || "true".equals(en);
-            allowBuffer = !(Boolean.FALSE.equals(en) || "false".equals(en));
-        }
         // need to cache the events in case validation fails or buffering is enabled
-        if (buffer || (allowBuffer && shouldValidate(message) && !isRequestor(message))) {
-            cache = new CachingXmlEventWriter();
-            try {
-                cache.setNamespaceContext(origXmlWriter.getNamespaceContext());
-            } catch (XMLStreamException e) {
-                //ignorable, will just get extra namespace decls
+        if (shouldBuffer(message)) {
+            if (!(xmlWriter instanceof CachingXmlEventWriter)) {
+                cache = new CachingXmlEventWriter();
+                try {
+                    cache.setNamespaceContext(origXmlWriter.getNamespaceContext());
+                } catch (XMLStreamException e) {
+                    //ignorable, will just get extra namespace decls
+                }
+                xmlWriter = cache;
             }
-            xmlWriter = cache;
             out = null;
         }
         
@@ -119,8 +126,25 @@ public abstract class AbstractOutDatabindingInterceptor extends AbstractPhaseInt
             
             for (MessagePartInfo part : parts) {
                 if (objs.hasValue(part)) {
+                    NamespaceContext c = null;
+                    if (!part.isElement()
+                        && xmlWriter instanceof CachingXmlEventWriter) {
+                        try {
+                            c = xmlWriter.getNamespaceContext();
+                            xmlWriter.setNamespaceContext(new CachingXmlEventWriter.NSContext(null));
+                        } catch (XMLStreamException e) {
+                            //ignore
+                        }
+                    }
                     Object o = objs.get(part);
                     dataWriter.write(o, part, xmlWriter);
+                    if (c != null) {
+                        try {
+                            xmlWriter.setNamespaceContext(c);
+                        } catch (XMLStreamException e) {
+                            //ignore
+                        }
+                    }
                 }
             }
         }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java b/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
index 47c48cb..266b6a8 100644
--- a/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
+++ b/api/src/main/java/org/apache/cxf/staxutils/CachingXmlEventWriter.java
@@ -233,7 +233,7 @@ public class CachingXmlEventWriter implements XMLStreamWriter {
                                             Collections.EMPTY_SET.iterator()));
     }
     
-    private static class NSContext implements NamespaceContext {
+    public static class NSContext implements NamespaceContext {
         NamespaceContext parent;
         Map<String, String> map = new HashMap<String, String>();
         

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
index a5893c4..8ec9949 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCInInterceptor.java
@@ -223,5 +223,8 @@ public class RPCInInterceptor extends AbstractInDatabindingInterceptor {
             endpointInfo.setProperty("URI", wsdlDescription);
         }
         message.put(Message.WSDL_DESCRIPTION, wsdlDescription);
+        
+        // configure endpoint and operation level schema validation
+        setOperationSchemaValidation(operation.getOperationInfo(), message);        
     }    
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
index 9fa064b..a6fcdcb 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/RPCOutInterceptor.java
@@ -23,6 +23,7 @@ import java.util.logging.Logger;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
+import javax.xml.stream.events.XMLEvent;
 
 import org.apache.cxf.binding.soap.wsdl.extensions.SoapBody;
 import org.apache.cxf.common.logging.LogUtils;
@@ -35,6 +36,7 @@ import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.MessagePartInfo;
+import org.apache.cxf.staxutils.CachingXmlEventWriter;
 import org.apache.cxf.staxutils.StaxUtils;
 
 public class RPCOutInterceptor extends AbstractOutDatabindingInterceptor {
@@ -46,6 +48,7 @@ public class RPCOutInterceptor extends AbstractOutDatabindingInterceptor {
 
 
     public void handleMessage(Message message) {
+        XMLStreamWriter origXmlWriter = null;
         try {
             NSStack nsStack = new NSStack();
             nsStack.push();
@@ -56,7 +59,19 @@ public class RPCOutInterceptor extends AbstractOutDatabindingInterceptor {
             assert operation.getName() != null;
 
             XMLStreamWriter xmlWriter = getXMLStreamWriter(message);
-
+            CachingXmlEventWriter cache = null;
+            // need to cache the events in case validation fails or buffering is enabled
+            if (shouldBuffer(message)) {
+                origXmlWriter = xmlWriter;
+                cache = new CachingXmlEventWriter();
+                try {
+                    cache.setNamespaceContext(xmlWriter.getNamespaceContext());
+                } catch (XMLStreamException e) {
+                    //ignorable, will just get extra namespace decls
+                }
+                message.setContent(XMLStreamWriter.class, cache);
+                xmlWriter = cache;
+            }
 
             List<MessagePartInfo> parts = null;
 
@@ -97,9 +112,24 @@ public class RPCOutInterceptor extends AbstractOutDatabindingInterceptor {
             writeParts(message, message.getExchange(), operation, objs, parts);
 
             // Finishing the writing.
-            xmlWriter.writeEndElement();            
+            xmlWriter.writeEndElement();
+            
+            
+            if (cache != null) {
+                try {
+                    for (XMLEvent event : cache.getEvents()) {
+                        StaxUtils.writeEvent(event, origXmlWriter);
+                    }
+                } catch (XMLStreamException e) {
+                    throw new Fault(e);
+                }
+            }
         } catch (XMLStreamException e) {
             throw new Fault(e);
+        } finally {
+            if (origXmlWriter != null) {
+                message.setContent(XMLStreamWriter.class, origXmlWriter);
+            }
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/JavaFirstSchemaValidationTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/JavaFirstSchemaValidationTest.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/JavaFirstSchemaValidationTest.java
index 8eb5c8c..888e5a8 100644
--- a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/JavaFirstSchemaValidationTest.java
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/JavaFirstSchemaValidationTest.java
@@ -21,6 +21,7 @@ package org.apache.cxf.systest.jaxws.schemavalidation;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -31,6 +32,7 @@ import org.apache.cxf.annotations.SchemaValidation.SchemaValidationType;
 import org.apache.cxf.endpoint.Client;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.feature.Feature;
+import org.apache.cxf.feature.LoggingFeature;
 import org.apache.cxf.feature.validation.DefaultSchemaValidationTypeProvider;
 import org.apache.cxf.feature.validation.SchemaValidationFeature;
 import org.apache.cxf.frontend.ClientProxy;
@@ -39,7 +41,6 @@ import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.testutil.common.TestUtil;
-
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -55,6 +56,7 @@ public class JavaFirstSchemaValidationTest extends Assert {
     private static List<Server> serverList = new ArrayList<Server>();
     private static PersonServiceAnnotated annotatedClient;
     private static PersonService client;
+    private static PersonServiceRPC rpcClient;
 
     @BeforeClass
     public static void startServers() throws Exception {
@@ -69,10 +71,13 @@ public class JavaFirstSchemaValidationTest extends Assert {
 
         createServer(PersonService.class, new PersonServiceImpl(), feature);
 
-        createServer(PersonServiceAnnotated.class, new PersonServiceAnnotatedImpl(), null);
+        createServer(PersonServiceAnnotated.class, new PersonServiceAnnotatedImpl());
+
+        createServer(PersonServiceRPC.class, new PersonServiceRPCImpl(), feature, new LoggingFeature());
 
         annotatedClient = createClient(PersonServiceAnnotated.class);
         client = createClient(PersonService.class);
+        rpcClient = createClient(PersonServiceRPC.class);
     }
 
     @AfterClass
@@ -85,7 +90,27 @@ public class JavaFirstSchemaValidationTest extends Assert {
     static String getAddress(Class<?> sei) {
         return "http://localhost:" + PORT + "/" + sei.getSimpleName();
     }
+    
+
+    @Test
+    public void testRPCLit() throws Exception { 
+        Person person = new Person();
+        person.setFirstName("Foo");
+        person.setLastName("Bar");
+        //this should work
+        rpcClient.saveValidateOut(person);
+        
+        try {
+            person.setFirstName(null);
+            rpcClient.saveValidateOut(person);
+        } catch (SOAPFaultException sfe) {
+            // verify its server side and a schema validation
+            assertTrue(sfe.getMessage().contains("Marshalling Error"));
+            assertTrue(sfe.getMessage().contains("lastName"));
+        }            
+    }
 
+    
     // so this is the default, we are inheriting from the service level SchemaValidation annotation
     // which is set to BOTH
     @Test
@@ -261,12 +286,12 @@ public class JavaFirstSchemaValidationTest extends Assert {
         return newClient;
     }
 
-    public static Server createServer(Class<?> serviceInterface, Object serviceImpl, Feature feature)
+    public static Server createServer(Class<?> serviceInterface, Object serviceImpl, Feature ... features)
         throws IOException {
         JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
         svrFactory.setServiceClass(serviceImpl.getClass());
-        if (feature != null) {
-            svrFactory.getFeatures().add(feature);
+        if (features != null) {
+            svrFactory.getFeatures().addAll(Arrays.asList(features));
         }
         svrFactory.setAddress(getAddress(serviceInterface));
         svrFactory.setServiceBean(serviceImpl);

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPC.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPC.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPC.java
new file mode 100644
index 0000000..7af971a
--- /dev/null
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPC.java
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxws.schemavalidation;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.apache.cxf.annotations.SchemaValidation;
+import org.apache.cxf.annotations.SchemaValidation.SchemaValidationType;
+
+@WebService(name = "PersonServiceRPC", targetNamespace = "http://org.apache.cxf/service/PersonService")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@SchemaValidation(type = SchemaValidationType.BOTH)
+public interface PersonServiceRPC {
+    @WebMethod(operationName = "saveInheritEndpoint")
+    Person saveInheritEndpoint(@WebParam(name = "Person") Person data);
+
+    @WebMethod(operationName = "saveNoValidation")
+    Person saveNoValidation(@WebParam(name = "Person") Person data);
+
+    @WebMethod(operationName = "saveValidateIn")
+    Person saveValidateIn(@WebParam(name = "Person") Person data);
+
+    @WebMethod(operationName = "saveValidateOut")
+    Person saveValidateOut(@WebParam(name = "Person") Person data);
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPCImpl.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPCImpl.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPCImpl.java
new file mode 100644
index 0000000..d11b3fa
--- /dev/null
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/PersonServiceRPCImpl.java
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.jaxws.schemavalidation;
+
+import javax.jws.WebService;
+
+@WebService(endpointInterface = "org.apache.cxf.systest.jaxws.schemavalidation.PersonServiceRPC", 
+    serviceName = "PersonServiceRPC", 
+    targetNamespace = "http://org.apache.cxf/service/PersonService")
+public class PersonServiceRPCImpl implements PersonServiceRPC {
+    @Override
+    public Person saveNoValidation(Person data) {
+        return data;
+    }
+
+    @Override
+    public Person saveInheritEndpoint(Person data) {
+        return data;
+    }
+
+    @Override
+    public Person saveValidateIn(Person data) {
+        return data;
+    }
+
+    @Override
+    public Person saveValidateOut(Person data) {
+        return data;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/d1e26dbf/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/package-info.java
----------------------------------------------------------------------
diff --git a/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/package-info.java b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/package-info.java
new file mode 100644
index 0000000..4ae90c0
--- /dev/null
+++ b/systests/jaxws/src/test/java/org/apache/cxf/systest/jaxws/schemavalidation/package-info.java
@@ -0,0 +1,21 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://org.apache.cxf/service/PersonService", 
+    elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+package org.apache.cxf.systest.jaxws.schemavalidation;


[2/5] git commit: Add some debug logging if an optional extension isn't loaded

Posted by dk...@apache.org.
Add some debug logging if an optional extension isn't loaded


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5d717eeb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5d717eeb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5d717eeb

Branch: refs/heads/2.7.x-fixes
Commit: 5d717eeb37bbc36c3891acae559830c696f7e428
Parents: 22e6b39
Author: Daniel Kulp <dk...@apache.org>
Authored: Thu Jun 12 13:07:10 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jun 13 11:04:56 2014 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/bus/extension/Extension.java   | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5d717eeb/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java b/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
index 4722069..d608a14 100644
--- a/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
+++ b/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java
@@ -24,6 +24,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import org.apache.cxf.Bus;
@@ -242,12 +243,16 @@ public class Extension {
             notFound = true;
             if (!optional) {
                 throw ex;
+            } else {
+                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
         } catch (InvocationTargetException ex) {
             notFound = true;
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS", LOG, cls.getName()), 
                                              ex.getCause());
+            } else {
+                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
         } catch (NoSuchMethodException ex) {
             notFound = true;
@@ -261,11 +266,15 @@ public class Extension {
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_FINDING_CONSTRUCTOR", LOG,
                                                          cls.getName(), a), ex);
+            } else {
+                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)ex);
             }
         } catch (Throwable e) {
             notFound = true;
             if (!optional) {
                 throw new ExtensionException(new Message("PROBLEM_CREATING_EXTENSION_CLASS", LOG, cls.getName()), e);
+            } else {
+                LOG.log(Level.FINE, "Could not load optional extension " + getName(), (Throwable)e);
             }
         }
         return obj;


[5/5] git commit: Fix test failure

Posted by dk...@apache.org.
Fix test failure


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ec3deed2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ec3deed2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ec3deed2

Branch: refs/heads/2.7.x-fixes
Commit: ec3deed2b04f2d83c65bdaa6d60fc0929c9f0c0a
Parents: ddaf7a7
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Jun 13 11:29:03 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jun 13 11:29:03 2014 -0400

----------------------------------------------------------------------
 .../org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ec3deed2/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java
index 117792f..5fd385b 100644
--- a/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java
+++ b/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/aegis/AegisJSONProviderTest.java
@@ -87,7 +87,7 @@ public class AegisJSONProviderTest extends Assert {
         AbstractAegisProvider.clearContexts();
         if (setNsMap) {
             Map<String, String> namespaceMap = new HashMap<String, String>();
-            namespaceMap.put("http://fortest.jaxrs.cxf.apache.org", "ns1");
+            namespaceMap.put("http://resources.jaxrs.cxf.apache.org", "ns1");
             namespaceMap.put("http://www.w3.org/2001/XMLSchema-instance", "xsi");
             p.setNamespaceMap(namespaceMap);
         }


[4/5] git commit: Recording .gitmergeinfo Changes

Posted by dk...@apache.org.
Recording .gitmergeinfo Changes


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/ddaf7a73
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/ddaf7a73
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/ddaf7a73

Branch: refs/heads/2.7.x-fixes
Commit: ddaf7a73a411bbce4d6ac1183aade968939a16e8
Parents: d1e26db
Author: Daniel Kulp <dk...@apache.org>
Authored: Fri Jun 13 11:05:13 2014 -0400
Committer: Daniel Kulp <dk...@apache.org>
Committed: Fri Jun 13 11:05:13 2014 -0400

----------------------------------------------------------------------
 .gitmergeinfo | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/ddaf7a73/.gitmergeinfo
----------------------------------------------------------------------
diff --git a/.gitmergeinfo b/.gitmergeinfo
index 9030aaa..8f4fca9 100644
--- a/.gitmergeinfo
+++ b/.gitmergeinfo
@@ -321,6 +321,7 @@ B 44204faaabc25977c42846ff27914294b6384079
 B 445c6ddae4952653ebad7ea15e23c42f51063b3f
 B 447d50a7f375f3133f7bb472e67819da4088aae8
 B 44b25ebe870e4d86b8c6d1c1aa945278e5e8ca3f
+B 44b35f1193552619bf6ff843254a5db0b8104263
 B 44de359f3e33b5cec829848f253e3a092c9989be
 B 454a6f84e0accbae7647b537fc9f5402df85e881
 B 458b211d7fd31e1440537ab445f3dbec0c5f7534
@@ -957,6 +958,7 @@ B da877145dcfad9de38aa92e92f5b0d1d2c9a20b3
 B da8972f3d4e92b18f464009ec27228cef0069da5
 B dac9e8404e0854813c8ed97e181eb3e0cf24b474
 B dae56b90c1de0dce1c00abe12108e364934eccf7
+B db2f02a91c7a9fb7ef88c34475f8a97d46a7ffad
 B db328134ef7acd3d7d46163666d5f6f4c59a8712
 B db6d55988ee70dfa3e751d4de13cac43005fc3f6
 B db84f3f6128c4c670f1b328a5aeb6b2617af48a9
@@ -1092,6 +1094,7 @@ B f7326964676a63a89a62892f9994d95aae16a68d
 B f761107ca5f9e2172fa159d31317df1a6fbd5df5
 B f8c17ef0a99195ea18c54c8718fa3f1d5e7cb41c
 B f8e3111979f85cbb612cbf1d6bc2e090d08adf6e
+B f912f16cf94631d09ab7be7241687b8e8696625f
 B f9b4939d483b43eb72ad165f995e763ce6bc34d8
 B f9b7c426504623033043960f81fdf6991f661e20
 B f9d34aa106502f8f74f2475de3c10f942c9d2cb5
@@ -1361,6 +1364,7 @@ M 635578a9d0a4cc1087795c26479585998d4a828f
 M 6358dc0577bb2ff41f91a6c3ac121a75d3da1a6e
 M 637963158121f8cd21e68b20f31c521c86048248
 M 63dce4850acf497e08cc692c5ad03d3d0788eae9
+M 63e985d05127a64dbfa6acfbb5c0f3ffb916fad5
 M 63f922255e228e4310335ad0b73309a66b735744
 M 643a6962ca28c2ad5b93ad0bff4309de372c261e
 M 652fab32f3ae5ffa3b4cb6290d654eadbdfd39a2
@@ -1414,6 +1418,7 @@ M 7c5edcc97b0702602d5fd2dc2324031efefe6430
 M 7d3bc771c321be9bc09816611b52e3c0e04323ef
 M 7f4f3630c35dbe78d9bbff2359a128db52b8cd8c
 M 7f75a2fc5a71f646d8647cf9b5e697f763e1edf2
+M 7fbe3b69b4e43f49cdfffc3c812c8d2ed29b3275
 M 7fd02d12a94352b7ce5a0260906a90997342dc42
 M 82c9c7d40f5dbfe905b9c7c7f59ed44c3634a003
 M 82cde9eefdf806ca1df735f350b4ae452ef84ca0
@@ -1470,6 +1475,7 @@ M 9bb928f7541c61a8a47c6a89db95155aad3153d0
 M 9c18083ec68a06a239104e58e497cb9bb5f745b4
 M 9c4675b7977e08fd9d6391313d13f0f8e08062cb
 M 9cf4485bc7843523da41d4b7095ff4f3430a05a9
+M 9ef7c5ebad8e5b26de79705056d20cb8bc92a107
 M 9f0a203134db988344ac0f4d71eb838e7c70784c
 M 9fa2780b617ed626f22d238ed1d3a39186b0f293
 M 9fc1a684696319f5ab1ced3924dd239abfc5a24a