You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ngocthobkdn <ng...@gmail.com> on 2015/10/08 16:45:12 UTC
Re: How to config jmx ACL for javax.management.MBeanServer
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.
Re: How to config jmx ACL for javax.management.MBeanServer
Posted by ngocthobkdn <ng...@gmail.com>.
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] <
ml-node+s922171n4042967h45@n3.nabble.com>:
> 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.
Re: How to config jmx ACL for javax.management.MBeanServer
Posted by ngocthobkdn <ng...@gmail.com>.
Hi JB,
I've just tested with karaf 4.0.1,
It works,
Thank you for your help,
Best regards.
2015-10-08 20:37 GMT+02:00 jbonofre [via Karaf] <
ml-node+s922171n4042972h0@n3.nabble.com>:
> Did you try on 4.0.1 ?
>
> Regards
> jB
>
> On 10/08/2015 05:57 PM, ngocthobkdn wrote:
>
> > Hi JB,
> > This code worked fine with Karaf 3.0.5.
> > However, it does not work with Karaf 4.0.0
> >
> > More ideas ?
> > Thanks,
> >
> > 2015-10-08 17:29 GMT+02:00 tho huynh ngoc <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=4042972&i=0>>:
> >
> >> 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] <
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4042972&i=1>>:
>
> >>
> >>> 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
> >>> <
> >>> .
> >>> 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-tp4033803p4042971.html
> > Sent from the Karaf - User mailing list archive at Nabble.com.
> >
>
> --
> Jean-Baptiste Onofré
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4042972&i=2>
> 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-tp4033803p4042972.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-tp4033803p4042973.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: How to config jmx ACL for javax.management.MBeanServer
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Did you try on 4.0.1 ?
Regards
jB
On 10/08/2015 05:57 PM, ngocthobkdn wrote:
> Hi JB,
> This code worked fine with Karaf 3.0.5.
> However, it does not work with Karaf 4.0.0
>
> More ideas ?
> Thanks,
>
> 2015-10-08 17:29 GMT+02:00 tho huynh ngoc <ng...@gmail.com>:
>
>> 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] <
>> ml-node+s922171n4042967h45@n3.nabble.com>:
>>
>>> 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-tp4033803p4042971.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: How to config jmx ACL for javax.management.MBeanServer
Posted by ngocthobkdn <ng...@gmail.com>.
Hi JB,
This code worked fine with Karaf 3.0.5.
However, it does not work with Karaf 4.0.0
More ideas ?
Thanks,
2015-10-08 17:29 GMT+02:00 tho huynh ngoc <ng...@gmail.com>:
> 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] <
> ml-node+s922171n4042967h45@n3.nabble.com>:
>
>> 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-tp4033803p4042971.html
Sent from the Karaf - User mailing list archive at Nabble.com.
Re: How to config jmx ACL for javax.management.MBeanServer
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com