hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sangjin Lee (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-12126) Configuration might use ApplicationClassLoader to create XML parser
Date Sat, 27 Jun 2015 02:19:04 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-12126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14603906#comment-14603906
] 

Sangjin Lee commented on HADOOP-12126:
--------------------------------------

I basically agree with the approach. Since DocumentBuilderFactory does not provide an option
of passing in only the constructor when it gets an instance, this might be the best way of
doing that.

Can you think of a way to write a unit test for this?

Also, it would be good to flip the state to "patch available" so we can run the jenkins on
the patch.

> Configuration might use ApplicationClassLoader to create XML parser
> -------------------------------------------------------------------
>
>                 Key: HADOOP-12126
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12126
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Laurent Goujon
>            Assignee: Laurent Goujon
>         Attachments: HADOOP-12126.001.patch
>
>
> {{org.apache.hadoop.conf.Configuration}} creates a new DocumentBuilder to parse the XML
config files, but it doesn't specify which classloader to use to discover and instantiate
the XML parser.
> Because DocumentBuilderFactory relies on ServiceProvider, whose by default, uses the
context classloader. If classpath isolation is turned on, one might expect that that Configuration
will only load classes from the system classloader, but it turns out that the context classloader
is set to ApplicationClassLoader, and that a XML parser might be loaded from the user classpath.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message