Bug 41931

Summary: XPathFactory only searches system classloader for service files
Product: XmlCommons - Now in JIRA Reporter: Brett Finnell <brettf2002>
Component: JAXPAssignee: Commons Developers Mailing List <commons-dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.x   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Proposed patch to search context classloader when available

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.