[
https://issues.apache.org/jira/browse/KARAF-3114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14062102#comment-14062102
]
Guillaume Nodet commented on KARAF-3114:
----------------------------------------
Weird, i tried that and it succeeded.
Fwiw, I fixed a bug with the admin role recently, so that may have impacted (in
the right way) the behavior : if the user does not have the admin role, the
call will fail, and that was the case before I fixed
https://github.com/apache/karaf/commit/728cbec8d03fb43fbbfbcb12d80951bd52f80416
> Call to ManagementFactory.getPlatformMBeanServer() fail due to RBAC
> -------------------------------------------------------------------
>
> Key: KARAF-3114
> URL: https://issues.apache.org/jira/browse/KARAF-3114
> Project: Karaf
> Issue Type: Bug
> Components: karaf-core, karaf-security
> Affects Versions: 3.0.1
> Reporter: Jean-Baptiste Onofré
> Assignee: Jean-Baptiste Onofré
> Fix For: 2.4.0, 4.0.0, 3.0.2
>
>
> With the introduction of the RBAC support to secure the JMX layer, a simple
> ManagementFactory.getPlatformMBeanServer() fails with something like:
> {code}
> java.lang.NullPointerException
> at
> org.apache.karaf.management.KarafMBeanServerGuard.canBypassRBAC(KarafMBeanServerGuard.java:236)
> at
> org.apache.karaf.management.KarafMBeanServerGuard.handleInvoke(KarafMBeanServerGuard.java:259)
> at
> org.apache.karaf.management.KarafMBeanServerGuard.invoke(KarafMBeanServerGuard.java:78)
> at
> org.apache.karaf.management.boot.KarafMBeanServerBuilder$MBeanInvocationHandler.invoke(KarafMBeanServerBuilder.java:63)[karaf-jmx-boot.jar:]
> at com.sun.proxy.$Proxy0.invoke(Unknown Source)[:]
> at
> com.sun.jmx.mbeanserver.MXBeanProxy$InvokeHandler.invoke(MXBeanProxy.java:150)[:1.7.0_60]
> at
> com.sun.jmx.mbeanserver.MXBeanProxy.invoke(MXBeanProxy.java:167)[:1.7.0_60]
> at
> javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:252)[:1.7.0_60]
> at com.sun.proxy.$Proxy19.dumpHeap(Unknown Source)[:]
> at
> org.apache.karaf.diagnostic.core.internal.HeapDumpProvider.createDump(HeapDumpProvider.java:45)
> {code}
> A workaround is to use a JMXServiceURL and JMXConnector instead, but it could
> be disturbing for the users.
--
This message was sent by Atlassian JIRA
(v6.2#6252)