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

Jean-Baptiste Onofré commented on KARAF-3114:
---------------------------------------------

OK, I found the issue: the KarafMBeanServerGuard is looking for JMX ACL 
Whitelist on ConfigAdmin, but it doesn't test if the configs returned are null 
(which is the case if no whitelist is provided). I'm fixing that.

By the way, the {{karaf.admin.role}} property is not really used in the code 
for now, I created another Jira about that.

> 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)

Reply via email to