You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Robert Munteanu <ro...@apache.org> on 2015/04/22 15:07:39 UTC

Quickest way of running oak to validate DocumentNodeStore mbeans

Hi,

I've built Oak from trunk and want to access the 
DocumentNodeStoreMBean. I see that the mbeans are not registered when 
using oak-run ( I assume that this happens because there is no OSGi 
environment available ).

I can always install a custom version of Oak in Sling, but I was 
wondering whether there's a faster way of running a locally-built Oak 
in an OSGi environment.

Thanks,

Robert

Re: Quickest way of running oak to validate DocumentNodeStore mbeans

Posted by Chetan Mehrotra <ch...@gmail.com>.
On Thu, Apr 23, 2015 at 3:51 PM, Robert Munteanu <ro...@apache.org> wrote:
> Some of the specific MBeans do not appear and only
> seem to be registered by the DocumentNodeStoreService ( see [2] ).
> That was what lead me to believe that JMX MBean registration is tied
> to OSGi. Is this available for registration in another way in oak-run?

Aah yup those would get missed out in non OSGi runs. To see them in
non OSGi env you would have to make use of oak-pojosr module. Launch
repo using that and then have it running. Might require some more
tweaks

Chetan Mehrotra

Re: Quickest way of running oak to validate DocumentNodeStore mbeans

Posted by Robert Munteanu <ro...@apache.org>.
On Thu, Apr 23, 2015 at 1:14 PM, Robert Munteanu <ro...@apache.org> wrote:
> Hi Chetan,
>
> On Thu, 2015-04-23 at 10:03 +0530, Chetan Mehrotra wrote:
>> > I assume that this happens because there is no OSGi environment
>> > available
>>
>> Thats not the case. MBean would be registered only if a MBeanServer
>> is
>> provided while constructing Oak instance (in non OSGi env). So in
>> oak-run where Oak instance is created if you also set MBeanServer
>>
>> Something like
>> Oak oak = ..
>> oak.with(ManagementFactory.getPlatformMBeanServer());
>>
>> This would lead to registration of MBean
>
> Thanks for the pointer. Filed
>
>   https://issues.apache.org/jira/browse/OAK-2805
>
> with a trivial patch to enable JMX MBean registration for oak-run.

Note however that this does not register all available MBeans for the
DocumentNodeStore. Some of the specific MBeans do not appear and only
seem to be registered by the DocumentNodeStoreService ( see [2] ).
That was what lead me to believe that JMX MBean registration is tied
to OSGi. Is this available for registration in another way in oak-run?

Thanks,

Robert


[2]: https://github.com/apache/jackrabbit-oak/blob/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java#L503-L508

>
> Robert
>
>> Chetan Mehrotra
>>
>>
>> On Wed, Apr 22, 2015 at 6:37 PM, Robert Munteanu <rombert@apache.org
>> > wrote:
>> > Hi,
>> >
>> > I've built Oak from trunk and want to access the
>> > DocumentNodeStoreMBean. I see that the mbeans are not registered
>> > when
>> > using oak-run ( I assume that this happens because there is no OSGi
>> > environment available ).
>> >
>> > I can always install a custom version of Oak in Sling, but I was
>> > wondering whether there's a faster way of running a locally-built
>> > Oak
>> > in an OSGi environment.
>> >
>> > Thanks,
>> >
>> > Robert
>

Re: Quickest way of running oak to validate DocumentNodeStore mbeans

Posted by Robert Munteanu <ro...@apache.org>.
Hi Chetan,

On Thu, 2015-04-23 at 10:03 +0530, Chetan Mehrotra wrote:
> > I assume that this happens because there is no OSGi environment 
> > available
> 
> Thats not the case. MBean would be registered only if a MBeanServer 
> is
> provided while constructing Oak instance (in non OSGi env). So in
> oak-run where Oak instance is created if you also set MBeanServer
> 
> Something like
> Oak oak = ..
> oak.with(ManagementFactory.getPlatformMBeanServer());
> 
> This would lead to registration of MBean

Thanks for the pointer. Filed

  https://issues.apache.org/jira/browse/OAK-2805

with a trivial patch to enable JMX MBean registration for oak-run.

Robert

> Chetan Mehrotra
> 
> 
> On Wed, Apr 22, 2015 at 6:37 PM, Robert Munteanu <rombert@apache.org
> > wrote:
> > Hi,
> > 
> > I've built Oak from trunk and want to access the
> > DocumentNodeStoreMBean. I see that the mbeans are not registered 
> > when
> > using oak-run ( I assume that this happens because there is no OSGi
> > environment available ).
> > 
> > I can always install a custom version of Oak in Sling, but I was
> > wondering whether there's a faster way of running a locally-built 
> > Oak
> > in an OSGi environment.
> > 
> > Thanks,
> > 
> > Robert


Re: Quickest way of running oak to validate DocumentNodeStore mbeans

Posted by Chetan Mehrotra <ch...@gmail.com>.
> I assume that this happens because there is no OSGi environment available

Thats not the case. MBean would be registered only if a MBeanServer is
provided while constructing Oak instance (in non OSGi env). So in
oak-run where Oak instance is created if you also set MBeanServer

Something like
Oak oak = ..
oak.with(ManagementFactory.getPlatformMBeanServer());

This would lead to registration of MBean
Chetan Mehrotra


On Wed, Apr 22, 2015 at 6:37 PM, Robert Munteanu <ro...@apache.org> wrote:
> Hi,
>
> I've built Oak from trunk and want to access the
> DocumentNodeStoreMBean. I see that the mbeans are not registered when
> using oak-run ( I assume that this happens because there is no OSGi
> environment available ).
>
> I can always install a custom version of Oak in Sling, but I was
> wondering whether there's a faster way of running a locally-built Oak
> in an OSGi environment.
>
> Thanks,
>
> Robert