Author: rsearls
Date: 2013-11-21 12:24:09 -0500 (Thu, 21 Nov 2013)
New Revision: 18099
Added:
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
Modified:
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
Log:
BZ-966752: code is a preventive measure, making sure the serverside classloader is used.
Added:
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
===================================================================
---
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java
(rev 0)
+++
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/ServerSideDocumentBuilder.java 2013-11-21
17:24:09 UTC (rev 18099)
@@ -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/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java
===================================================================
---
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2013-11-21
10:06:14 UTC (rev 18098)
+++
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/JBossWSDLReaderImpl.java 2013-11-21
17:24:09 UTC (rev 18099)
@@ -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/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java
===================================================================
---
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2013-11-21
10:06:14 UTC (rev 18098)
+++
stack/native/branches/jbossws-native-4.1.x/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDLDefinitionsFactory.java 2013-11-21
17:24:09 UTC (rev 18099)
@@ -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);
Show replies by date