Author: dkulp
Date: Thu Dec 10 18:04:37 2009
New Revision: 889349
URL: http://svn.apache.org/viewvc?rev=889349&view=rev
Log:
[CXF-2571] More fixes for this on 2.1.x
Modified:
cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Modified:
cxf/branches/2.1.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.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java?rev=889349&r1=889348&r2=889349&view=diff
==============================================================================
---
cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
(original)
+++
cxf/branches/2.1.x-fixes/tools/wsdlto/databinding/jaxb/src/main/java/org/apache/cxf/tools/wsdlto/databinding/jaxb/JAXBDataBinding.java
Thu Dec 10 18:04:37 2009
@@ -68,6 +68,7 @@
import org.apache.cxf.Bus;
import org.apache.cxf.catalog.OASISCatalogManager;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
@@ -745,10 +746,12 @@
}
}
private static String mapSchemaLocation(String target, String base,
OASISCatalogManager catalog) {
+ if (base != null) {
+ base = mapSchemaLocation(base, null, catalog);
+ }
if (catalog != null) {
try {
String resolvedLocation =
catalog.getCatalog().resolveSystem(target);
-
if (resolvedLocation == null) {
resolvedLocation = catalog.getCatalog().resolveURI(target);
}
@@ -756,6 +759,13 @@
resolvedLocation =
catalog.getCatalog().resolvePublic(target, base);
}
if (resolvedLocation != null) {
+ if (resolvedLocation.startsWith("classpath:")) {
+ URL url =
ClassLoaderUtils.getResource(resolvedLocation.substring(10),
+
JAXBDataBinding.class);
+ if (url != null) {
+ resolvedLocation = url.toExternalForm();
+ }
+ }
return resolvedLocation;
}
@@ -772,6 +782,13 @@
} catch (Exception ex) {
//ignore
}
+ if (target.startsWith("classpath:")) {
+ URL url = ClassLoaderUtils.getResource(target.substring(10),
+ JAXBDataBinding.class);
+ if (url != null) {
+ target = url.toExternalForm();
+ }
+ }
return target;
}