Author: jfrederic.clere(a)jboss.com
Date: 2011-09-28 03:51:36 -0400 (Wed, 28 Sep 2011)
New Revision: 1843
Modified:
branches/2.1.x/java/org/apache/jasper/xmlparser/ParserUtils.java
branches/2.1.x/webapps/docs/changelog.xml
Log:
Fix for JBPAPP-7267
Modified: branches/2.1.x/java/org/apache/jasper/xmlparser/ParserUtils.java
===================================================================
--- branches/2.1.x/java/org/apache/jasper/xmlparser/ParserUtils.java 2011-09-23 16:47:53
UTC (rev 1842)
+++ branches/2.1.x/java/org/apache/jasper/xmlparser/ParserUtils.java 2011-09-28 07:51:36
UTC (rev 1843)
@@ -87,7 +87,7 @@
// Perform an XML parse of this document, via JAXP
try {
DocumentBuilderFactory factory =
- DocumentBuilderFactory.newInstance();
+ createDocumentBuilderFactory();
factory.setNamespaceAware(true);
factory.setValidating(validating);
DocumentBuilder builder = factory.newDocumentBuilder();
@@ -116,7 +116,7 @@
return (convert(null, document.getDocumentElement()));
}
-
+
/**
* Parse the specified XML document, and return a <code>TreeNode</code>
* that corresponds to the root node of the document tree.
@@ -184,6 +184,22 @@
// Return the completed TreeNode graph
return (treeNode);
}
+
+ protected static DocumentBuilderFactory createDocumentBuilderFactory()
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ DocumentBuilderFactory factory;
+ try
+ {
+
Thread.currentThread().setContextClassLoader(ParserUtils.class.getClassLoader());
+ factory = DocumentBuilderFactory.newInstance();
+ }
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(cl);
+ }
+ return factory;
+ }
}
Modified: branches/2.1.x/webapps/docs/changelog.xml
===================================================================
--- branches/2.1.x/webapps/docs/changelog.xml 2011-09-23 16:47:53 UTC (rev 1842)
+++ branches/2.1.x/webapps/docs/changelog.xml 2011-09-28 07:51:36 UTC (rev 1843)
@@ -23,6 +23,13 @@
</fix>
</changelog>
</subsection>
+ <subsection name="Jasper">
+ <changelog>
+ <fix>
+ <jira>JBPAPP-7267</jira> ParserUtils uses JAXP in a non-modular
classloading compatible way (jfclere)
+ </fix>
+ </changelog>
+ </subsection>
</section>
<section name="JBoss Web 2.1.12.GA (jfclere)">
Show replies by date