cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r796022 - in /cxf/trunk: rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
Date Mon, 20 Jul 2009 21:27:23 GMT
Author: dkulp
Date: Mon Jul 20 21:27:19 2009
New Revision: 796022

URL: http://svn.apache.org/viewvc?rev=796022&view=rev
Log:
[CXF-2083] Fix problem with xmlbeans when using relative paths in
xsd:imports

Modified:
    cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
    cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java

Modified: cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java?rev=796022&r1=796021&r2=796022&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
(original)
+++ cxf/trunk/rt/databinding/xmlbeans/src/main/java/org/apache/cxf/xmlbeans/XmlBeansSchemaInitializer.java
Mon Jul 20 21:27:19 2009
@@ -24,6 +24,7 @@
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.math.BigInteger;
+import java.net.URI;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -130,9 +131,12 @@
             Element elem = DOMUtils.getFirstElement(doc.getDocumentElement());
             while (elem != null) {
                 if (elem.getLocalName().equals("import")) {
+                    URI uri = new URI(file);
                     String loc = elem.getAttribute("schemaLocation");
                     if (!StringUtils.isEmpty(loc)) {
-                        getSchema(sts, loc);
+                        URI locUri = uri.resolve(loc);
+                        String newLoc = locUri.toString();
+                        getSchema(sts, newLoc);
                     }
                 }                 
                 elem = DOMUtils.getNextElement(elem);

Modified: cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java?rev=796022&r1=796021&r2=796022&view=diff
==============================================================================
--- cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java (original)
+++ cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/common/ClassUtils.java Mon Jul
20 21:27:19 2009
@@ -64,7 +64,12 @@
             argList.add(getClass().getClassLoader().getResource(".").getFile() + "../lib/");
         } else {
             argList.add("-classpath");
-            argList.add(javaClasspath);
+            if (context.get(ToolConstants.CFG_OUTPUTDIR) != null) { 
+                argList.add(javaClasspath + File.pathSeparatorChar 
+                            + context.get(ToolConstants.CFG_OUTPUTDIR));
+            } else {
+                argList.add(javaClasspath);
+            }
         }
 
         String outPutDir = (String)context.get(ToolConstants.CFG_OUTPUTDIR);



Mime
View raw message