Author: asoldano
Date: 2014-02-13 08:14:27 -0500 (Thu, 13 Feb 2014)
New Revision: 18356
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
Log:
[JBWS-3763] [BZ-966752] svn merge -r 18098:18099
https://svn.jboss.org/repos/jbossws/stack/native/branches/jbossws-native-... .
Copied:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
(from rev 18099,
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java)
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
(rev 0)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java 2014-02-13
13:14:27 UTC (rev 18356)
@@ -0,0 +1,23 @@
+package org.jboss.ws.tools;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * Require the TCCL to this framework's classloader.
+ *
+ * User: rsearls
+ * Date: 11/20/13
+ */
+public class ServerSideDocumentBuilder {
+ public static DocumentBuilderFactory createDocumentBuilderFactory() {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ DocumentBuilderFactory factory;
+ try {
+
Thread.currentThread().setContextClassLoader(ServerSideDocumentBuilder.class.getClassLoader());
+ factory = DocumentBuilderFactory.newInstance();
+ } finally {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ return factory;
+ }
+}
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2014-02-13
13:04:04 UTC (rev 18355)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2014-02-13
13:14:27 UTC (rev 18356)
@@ -68,6 +68,7 @@
import org.jboss.ws.NativeMessages;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
+import org.jboss.ws.tools.ServerSideDocumentBuilder;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -2142,7 +2143,7 @@
private static Document getDocument(InputSource inputSource,
String desc) throws WSDLException
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory =
ServerSideDocumentBuilder.createDocumentBuilderFactory();
factory.setNamespaceAware(true);
factory.setValidating(false);
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2014-02-13
13:04:04 UTC (rev 18355)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2014-02-13
13:14:27 UTC (rev 18356)
@@ -43,6 +43,7 @@
import org.jboss.ws.common.utils.ResourceURL;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
import org.jboss.ws.metadata.wsdl.WSDLException;
+import org.jboss.ws.tools.ServerSideDocumentBuilder;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -168,7 +169,7 @@
InputStream inputStream = new ResourceURL(wsdlLocation).openStream();
try
{
- DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+ DocumentBuilderFactory factory =
ServerSideDocumentBuilder.createDocumentBuilderFactory();
factory.setNamespaceAware(true);
factory.setValidating(false);