Hi,

A problem that there is not the file etc/jmx.acl.whitelist.cfg in Karaf
4.0.0
I tried to create a file etc/jmx.acl.whitelist.cfg with
java.lang.OperatingSystem=bypass
but it does not work.

This is my code:

HashMap<String, String[]> environment = new HashMap<String, String[]>();
         String username = "karaf";
         String password = "karaf";
         String[] credentials = new String[] { username, password };
         environment.put("jmx.remote.credentials", credentials);

        // String[] ssl = new String[] { "false" };
        // environment.put("com.sun.management.jmxremote.ssl",ssl);
         //192.168.56.2 is IP of a host containing remote Karaf
         JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://
192.168.56.2:44444/jndi/rmi://192.168.56.2:1099/karaf-root");
         JMXConnector jmxc = JMXConnectorFactory.connect(url, environment);
         MBeanServerConnection mbsc = jmxc.getMBeanServerConnection();

         ObjectName mbeanName = new
ObjectName("osgi.core:type=framework,version=1.7,"
                 +
"framework=org.apache.felix.framework,uuid=0475b364-f378-444f-a76f-d9a9da059c41");
         FrameworkMBean osgiFrameworkProxy = JMX.newMBeanProxy(mbsc,
mbeanName,
                    FrameworkMBean.class);
         System.out.println(osgiFrameworkProxy.getFrameworkStartLevel());
//=> ok: print 100
         long bundleNumber =
osgiFrameworkProxy.installBundle("file:bundles/snb.jar");
         osgiFrameworkProxy.startBundle(bundleNumber);

And this is an error:

Exception in thread "main" java.lang.SecurityException: Insufficient
roles/crede
ntials for operation

Regards,


2015-10-08 16:51 GMT+02:00 jbonofre [via Karaf] <
[email protected]>:

> Hi,
>
> same thing as already said in this thread:
>
> etc/jmx.acl.whitelist.cfg
> java.lang.OperatingSystem=bypass
>
> On 10/08/2015 04:45 PM, ngocthobkdn wrote:
>
> > Hi,
> >
> > I have the same issue.
> > I use karaf 4.0.0.1
> >
> > Any idea ?
> > Thanks,
> >
> >
> >
> > --
> > View this message in context:
> http://karaf.922171.n3.nabble.com/How-to-config-jmx-ACL-for-javax-management-MBeanServer-tp4033803p4042966.html
> > Sent from the Karaf - User mailing list archive at Nabble.com.
> >
>
> --
> Jean-Baptiste Onofré
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4042967&i=0>
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://karaf.922171.n3.nabble.com/How-to-config-jmx-ACL-for-javax-management-MBeanServer-tp4033803p4042967.html
> To unsubscribe from How to config jmx ACL for
> javax.management.MBeanServer, click here
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4033803&code=bmdvY3Rob2JrZG5AZ21haWwuY29tfDQwMzM4MDN8OTE5ODczODM0>
> .
> NAML
> <http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: 
http://karaf.922171.n3.nabble.com/How-to-config-jmx-ACL-for-javax-management-MBeanServer-tp4033803p4042969.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to