[jboss-jira] [JBoss JIRA] (WFCORE-683) ListModuleRootsHandler and ModuleLocationHandler don't handle PrivilegedActionException properly
Tomaz Cerar (JIRA)
issues at jboss.org
Mon Feb 15 16:33:00 EST 2016
[ https://issues.jboss.org/browse/WFCORE-683?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13163236#comment-13163236 ]
Tomaz Cerar commented on WFCORE-683:
------------------------------------
instead of using reflection there is now proper api that is exposed via jmx.
example:
{code:java}
private static List<String> findResourcePaths(String moduleName) throws ModuleLoadException, ReflectiveOperationException {
ModuleLoaderMXBean loader = ModuleInfoHandler.getMxBean(Module.getCallerModuleLoader());
List<String> result = new LinkedList<>();
for (ResourceLoaderInfo rl : loader.getResourceLoaders(moduleName)){
if (rl.getLocation()!=null) {
result.add(new File(URI.create(rl.getLocation())).toString());
}
}
return result;
}
{code}
> ListModuleRootsHandler and ModuleLocationHandler don't handle PrivilegedActionException properly
> ------------------------------------------------------------------------------------------------
>
> Key: WFCORE-683
> URL: https://issues.jboss.org/browse/WFCORE-683
> Project: WildFly Core
> Issue Type: Bug
> Components: Domain Management
> Affects Versions: 1.0.0.CR1
> Reporter: Brian Stansberry
> Fix For: 3.0.0.Alpha1
>
>
> The two inner class OSHs in ModuleLoadingResourceDefinition don't deal with exceptions properly. They invoke AccessController.doPrivileged and then deal with any PrivilegedActionException by rethrowing as OperationFailedException.
> OperationFailedException represents a client mistake and is handled as such (e.g. isn't logged in the server log.) It shouldn't be thrown here unless the PrivilegedActionException.getCause() value is itself an OFE. Otherwise, the OSHs should throw a RuntimeException.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list