Bug 41931 - XPathFactory only searches system classloader for service files
Summary: XPathFactory only searches system classloader for service files
Status: RESOLVED FIXED
Alias: None
Product: XmlCommons - Now in JIRA
Classification: Unclassified
Component: JAXP (show other bugs)
Version: 1.x
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Commons Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-22 11:47 UTC by Brett Finnell
Modified: 2007-03-25 13:05 UTC (History)
0 users



Attachments
Proposed patch to search context classloader when available (1.09 KB, patch)
2007-03-22 11:49 UTC, Brett Finnell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brett Finnell 2007-03-22 11:47:35 UTC
When using the JAXP XPath interfaces in a multi-classloader environment such as
an application server, the newInstance method on XPathFactory fails to find any
javax.xml.xpath.XPathFactory service files as described in the API documentation
if the service file was loaded in a classloader other than the system classloader.

The reason for this can be found in the javax.xml.xpath.SecuritySupport class in
the getResources method.  The method will always use the getSystemResource
method instead of the getResource method on the context classloader.
Comment 1 Brett Finnell 2007-03-22 11:49:30 UTC
Created attachment 19774 [details]
Proposed patch to search context classloader when available
Comment 2 Michael Glavassevich 2007-03-25 13:05:34 UTC
The same bugs were also in javax.xml.validation.SecuritySupport. Both are fixed 
in SVN now. Thanks.