cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1378289 - in /cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb: JAXBBindErrorListener.java JAXBDataBinding.java
Date Tue, 28 Aug 2012 20:13:34 GMT
Author: dkulp
Date: Tue Aug 28 20:13:34 2012
New Revision: 1378289

URL: http://svn.apache.org/viewvc?rev=1378289&view=rev
Log:
[CXF-4487] Try to detect when Xerces if feeding warnings into JAXB and ignore those, but not
others that jaxb itself would be publishing.

Modified:
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
    cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java?rev=1378289&r1=1378288&r2=1378289&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
Tue Aug 28 20:13:34 2012
@@ -56,6 +56,17 @@ public class JAXBBindErrorListener imple
     }
 
     public void warning(org.xml.sax.SAXParseException exception) {
+        for (StackTraceElement el : new Exception().getStackTrace()) {
+            if (el.getClassName().contains("DowngradingErrorHandler")) {
+                //this is from within JAXB as it tries to validate the schemas
+                //Xerces has issues with schema imports that don't have a
+                //schemaLocation (or a schemaLocation that is not fully resolvable)
+                //and emits strange warnings that are completely not 
+                //correct so we'll try and skip them.
+                return;
+            }
+        }
+        
         if (this.isVerbose) {
             System.out.println("JAXB parsing schema warning " + exception.toString()
                                + " in schema " + exception.getSystemId());

Modified: cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=1378289&r1=1378288&r2=1378289&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/trunk/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Tue Aug 28 20:13:34 2012
@@ -811,18 +811,12 @@ public class JAXBDataBinding implements 
             return element;
         }
         element = (Element)cloneNode(element.getOwnerDocument(), element, true);
-        List<Node> ns = new ArrayList<Node>();
 
         impElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                        ToolConstants.SCHEMA_URI,
                                                        "import");
-        for (Element elem : impElemList) {
-            Node importNode = elem;
-            ns.add(importNode);
-        }
-        for (Node item : ns) {
-            Node schemaNode = item.getParentNode();
-            schemaNode.removeChild(item);
+        for (Element item : impElemList) {
+            item.removeAttribute("schemaLocation");
         }
 
         incElemList = DOMUtils.findAllElementsByTagNameNS(element,



Mime
View raw message