cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1378300 - in /cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb: JAXBBindErrorListener.java JAXBDataBinding.java
Date Tue, 28 Aug 2012 20:19:35 GMT
Author: dkulp
Date: Tue Aug 28 20:19:35 2012
New Revision: 1378300

URL: http://svn.apache.org/viewvc?rev=1378300&view=rev
Log:
Merged revisions 1378289 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1378289 | dkulp | 2012-08-28 16:13:34 -0400 (Tue, 28 Aug 2012) | 2 lines

  [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/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
    cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java

Modified: cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java?rev=1378300&r1=1378299&r2=1378300&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBBindErrorListener.java
Tue Aug 28 20:19:35 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/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=1378300&r1=1378299&r2=1378300&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++ cxf/branches/2.6.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Tue Aug 28 20:19:35 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