You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2009/03/21 19:27:39 UTC

svn commit: r756982 - in /cxf/trunk: common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/ common/xerces-xsd-validation/src/main/resources/META-INF/cxf/ parent/ rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/ rt/...

Author: bimargulies
Date: Sat Mar 21 18:27:39 2009
New Revision: 756982

URL: http://svn.apache.org/viewvc?rev=756982&view=rev
Log:
CXF-2123 -- all fixed. CXF-2126: one issue fixed, at least one more left.

Added:
    cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml   (with props)
    cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf.extension
Modified:
    cxf/trunk/common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/DOMLSInput.java
    cxf/trunk/parent/pom.xml
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties

Modified: cxf/trunk/common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/DOMLSInput.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/DOMLSInput.java?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/DOMLSInput.java (original)
+++ cxf/trunk/common/xerces-xsd-validation/src/main/java/org/apache/cxf/xsdvalidation/DOMLSInput.java Sat Mar 21 18:27:39 2009
@@ -53,7 +53,7 @@
         StreamResult result = new StreamResult(writer);
         transformer.transform(source, result);
         data = writer.toString();
-        LOG.fine(systemId + ": " + data);
+        LOG.warning(systemId + ": " + data);
         
     }
 

Added: cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml?rev=756982&view=auto
==============================================================================
--- cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml (added)
+++ cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml Sat Mar 21 18:27:39 2009
@@ -0,0 +1,30 @@
+<!--
+  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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="
+http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+	<bean id="org.apache.cxf.xsdvalidation.XercesXsdValidationImpl"
+		class="org.apache.cxf.xsdvalidation.XercesXsdValidationImpl"
+		>
+		<property name="bus" ref="cxf"/>
+	</bean>
+
+</beans>

Propchange: cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf-extension-xerces-xsd-validation.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf.extension
URL: http://svn.apache.org/viewvc/cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf.extension?rev=756982&view=auto
==============================================================================
--- cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf.extension (added)
+++ cxf/trunk/common/xerces-xsd-validation/src/main/resources/META-INF/cxf/cxf.extension Sat Mar 21 18:27:39 2009
@@ -0,0 +1 @@
+META-INF/cxf/cxf-extension-xerces-xsd-validation.xml
\ No newline at end of file

Modified: cxf/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/parent/pom.xml (original)
+++ cxf/trunk/parent/pom.xml Sat Mar 21 18:27:39 2009
@@ -1085,6 +1085,12 @@
     </reporting>
 
     <profiles>
+      <profile>
+	<id>validateServices</id>
+	<properties>
+	  <cxf.validateServices>true</cxf.validateServices>
+	</properties>
+      </profile>
         <profile>
             <!-- sjsxp is really the precursor to the jaxp-ri jars.   However, getting the jaxp-ri  jar to work on 
             Java 5 requires endorsing it which is non-trivial in maven  :-(.
@@ -1307,6 +1313,10 @@
                                     <name>java.security.properties</name>
                                     <value>${basedir}/target/test-classes/ibm.security</value>
                                 </property>
+				<property>
+				  <name>cxf.validateServiceSchemas</name>
+				  <value>${cxf.validateServices}</value>
+				</property>
                             </systemProperties>
                         </configuration>
                     </plugin>

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/databinding/AegisDatabinding.java Sat Mar 21 18:27:39 2009
@@ -500,6 +500,8 @@
                 schemaInfo.setSchema(schema);
                 si.addSchema(schemaInfo);
             }
+            // it's quite likely that the code in Aegis missed at least one ...
+            si.getXmlSchemaCollection().addCrossImports();
         }
     }
     

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java Sat Mar 21 18:27:39 2009
@@ -163,7 +163,18 @@
 
             QName name = info.getTypeName();
             if (name == null) {
-                name = createQName(info.getTypeClass());
+                // We do not want to use the java.lang.whatever schema type.
+                // If the @ annotation or XML file didn't specify a schema type,
+                // but the natural type has a schema type mapping, we use that rather
+                // than create nonsense.
+                if (info.getTypeClass().getPackage().getName().startsWith("java")) {
+                    name = tm.getTypeQName(info.getTypeClass());
+                }
+                // if it's still null, we'll take our lumps, but probably end up wih
+                // an invalid schema.
+                if (name == null) {
+                    name = createQName(info.getTypeClass());
+                }
             }
 
             type.setSchemaType(name);

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java Sat Mar 21 18:27:39 2009
@@ -510,17 +510,20 @@
     private void validateSchemas(XmlSchemaValidationManager xsdValidator, 
                                  SchemaCollection xmlSchemaCollection) {
         final boolean[] anyErrors = new boolean[1];
+        final StringBuilder errorBuilder = new StringBuilder();
         anyErrors[0] = false;
         xsdValidator.validateSchemas(xmlSchemaCollection.getXmlSchemaCollection(), new DOMErrorHandler() {
 
             public boolean handleError(DOMError error) {
                 anyErrors[0] = true;
+                errorBuilder.append(error.getMessage());
                 LOG.warning(error.getMessage());
                 return true;
             }
         });
         if (anyErrors[0]) {
-            throw new ServiceConstructionException(new Message("XSD_VALIDATION_ERROR", LOG));
+            throw new ServiceConstructionException(new Message("XSD_VALIDATION_ERROR", LOG,
+                                                               errorBuilder.toString()));
         }
     }
 

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties?rev=756982&r1=756981&r2=756982&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties (original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/SimpleMessages.properties Sat Mar 21 18:27:39 2009
@@ -31,4 +31,4 @@
 INTRACTABLE_PART= Message part {0} of Message {1} cannot be processed. This can be caused by the use of JAX-WS-specific types \
  without the JAX-WS service factory bean.
 JAXWS_ANNOTATION_FOUND=A JAX-WS Annotation was found on {0} while using the Simple frontend.  For better results, use the JAX-WS frontend.
-XSD_VALIDATION_ERROR= Error in W3C XML Schema associated with service.
\ No newline at end of file
+XSD_VALIDATION_ERROR= Error in W3C XML Schema associated with service: {0}
\ No newline at end of file