JMException throws during bundle reloads due to properties file changes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JMException throws during bundle reloads due to properties file changes

dantran
Hi I have a bundle with a MBean with it. When I changes a properties
belong to my bundle viat etc/my.bundle.cfg, karaf throws the following
execption


2012-01-11 13:33:54,221 | ERROR | rint Extender: 3 |
tServiceReferenceRecipe$Listener | tServiceReferenceRecipe$Listener
451 | 9 - org.apache.aries.blueprint - 0.3.1 | Error calling listener
method public void
org.apache.karaf.management.MBeanRegistrer.registerMBeanServer(javax.management.MBeanServer)
throws javax.management.JMException
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)[:1.7.0_b147]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_b147]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_b147]
        at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_b147]
        at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:448)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:430)[9:org.apache.aries.blueprint:0.3.1]
        at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:327)[9:org.apache.aries.blueprint:0.3.1]
        ........
Caused by: javax.management.InstanceAlreadyExistsException:
com.mycomp.mc.root:type=target,name=assets


So it seems karaf does not un-register my MBean first.


Note, and can use karaf shell to restart my bundle ( restart xyz), no
exception here.


 Is it a bug?

No so, after restart, the bundle 'seems' to operate, but I dont really
know the ramifications are.


One of work around, I am thinking, is to move the MBEANs another
bundle so that it never get reload. If it is a bug, should I go for
the workaround?


Thanks

-Dan
Reply | Threaded
Open this post in threaded view
|

Re: JMException throws during bundle reloads due to properties file changes

jbonofre
Hi Dan,

let me try to reproduce, it looks like in some case, the Karaf
MBeanRegistrer doesn't unregister the MBean from the MBean server.

I keep you posted.

Regards
JB

On 01/11/2012 11:03 PM, Dan Tran wrote:

> Hi I have a bundle with a MBean with it. When I changes a properties
> belong to my bundle viat etc/my.bundle.cfg, karaf throws the following
> execption
>
>
> 2012-01-11 13:33:54,221 | ERROR | rint Extender: 3 |
> tServiceReferenceRecipe$Listener | tServiceReferenceRecipe$Listener
> 451 | 9 - org.apache.aries.blueprint - 0.3.1 | Error calling listener
> method public void
> org.apache.karaf.management.MBeanRegistrer.registerMBeanServer(javax.management.MBeanServer)
> throws javax.management.JMException
> java.lang.reflect.InvocationTargetException
>          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)[:1.7.0_b147]
>          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_b147]
>          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_b147]
>          at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_b147]
>          at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[9:org.apache.aries.blueprint:0.3.1]
>          at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:448)[9:org.apache.aries.blueprint:0.3.1]
>          at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:430)[9:org.apache.aries.blueprint:0.3.1]
>          at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:327)[9:org.apache.aries.blueprint:0.3.1]
>          ........
> Caused by: javax.management.InstanceAlreadyExistsException:
> com.mycomp.mc.root:type=target,name=assets
>
>
> So it seems karaf does not un-register my MBean first.
>
>
> Note, and can use karaf shell to restart my bundle ( restart xyz), no
> exception here.
>
>
>   Is it a bug?
>
> No so, after restart, the bundle 'seems' to operate, but I dont really
> know the ramifications are.
>
>
> One of work around, I am thinking, is to move the MBEANs another
> bundle so that it never get reload. If it is a bug, should I go for
> the workaround?
>
>
> Thanks
>
> -Dan

--
Jean-Baptiste Onofré
[hidden email]
http://blog.nanthrax.net
Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: JMException throws during bundle reloads due to properties file changes

dantran
Thanks JB,

I also try to reproduce this using karaf mbean, but so far I am not
able to find a karaf's mbean similar to what i have.

-D

On Wed, Jan 11, 2012 at 11:05 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

> Hi Dan,
>
> let me try to reproduce, it looks like in some case, the Karaf
> MBeanRegistrer doesn't unregister the MBean from the MBean server.
>
> I keep you posted.
>
> Regards
> JB
>
>
> On 01/11/2012 11:03 PM, Dan Tran wrote:
>>
>> Hi I have a bundle with a MBean with it. When I changes a properties
>> belong to my bundle viat etc/my.bundle.cfg, karaf throws the following
>> execption
>>
>>
>> 2012-01-11 13:33:54,221 | ERROR | rint Extender: 3 |
>> tServiceReferenceRecipe$Listener | tServiceReferenceRecipe$Listener
>> 451 | 9 - org.apache.aries.blueprint - 0.3.1 | Error calling listener
>> method public void
>>
>> org.apache.karaf.management.MBeanRegistrer.registerMBeanServer(javax.management.MBeanServer)
>> throws javax.management.JMException
>> java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)[:1.7.0_b147]
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_b147]
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_b147]
>>         at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_b147]
>>         at
>> org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:448)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:430)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:327)[9:org.apache.aries.blueprint:0.3.1]
>>         ........
>> Caused by: javax.management.InstanceAlreadyExistsException:
>> com.mycomp.mc.root:type=target,name=assets
>>
>>
>> So it seems karaf does not un-register my MBean first.
>>
>>
>> Note, and can use karaf shell to restart my bundle ( restart xyz), no
>> exception here.
>>
>>
>>  Is it a bug?
>>
>> No so, after restart, the bundle 'seems' to operate, but I dont really
>> know the ramifications are.
>>
>>
>> One of work around, I am thinking, is to move the MBEANs another
>> bundle so that it never get reload. If it is a bug, should I go for
>> the workaround?
>>
>>
>> Thanks
>>
>> -Dan
>
>
> --
> Jean-Baptiste Onofré
> [hidden email]
> http://blog.nanthrax.net
> Talend - http://www.talend.com
Reply | Threaded
Open this post in threaded view
|

Re: JMException throws during bundle reloads due to properties file changes

dantran
In reply to this post by jbonofre
Thanks JB,

I also try to reproduce this using karaf mbean, but so far I am not
able to find a karaf's mbean similar to what i have.

-D

On Wed, Jan 11, 2012 at 11:05 PM, Jean-Baptiste Onofré <[hidden email]> wrote:

> Hi Dan,
>
> let me try to reproduce, it looks like in some case, the Karaf
> MBeanRegistrer doesn't unregister the MBean from the MBean server.
>
> I keep you posted.
>
> Regards
> JB
>
>
> On 01/11/2012 11:03 PM, Dan Tran wrote:
>>
>> Hi I have a bundle with a MBean with it. When I changes a properties
>> belong to my bundle viat etc/my.bundle.cfg, karaf throws the following
>> execption
>>
>>
>> 2012-01-11 13:33:54,221 | ERROR | rint Extender: 3 |
>> tServiceReferenceRecipe$Listener | tServiceReferenceRecipe$Listener
>> 451 | 9 - org.apache.aries.blueprint - 0.3.1 | Error calling listener
>> method public void
>>
>> org.apache.karaf.management.MBeanRegistrer.registerMBeanServer(javax.management.MBeanServer)
>> throws javax.management.JMException
>> java.lang.reflect.InvocationTargetException
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)[:1.7.0_b147]
>>         at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_b147]
>>         at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_b147]
>>         at java.lang.reflect.Method.invoke(Method.java:601)[:1.7.0_b147]
>>         at
>> org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.invokeMethods(AbstractServiceReferenceRecipe.java:448)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$Listener.bind(AbstractServiceReferenceRecipe.java:430)[9:org.apache.aries.blueprint:0.3.1]
>>         at
>> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.bind(AbstractServiceReferenceRecipe.java:327)[9:org.apache.aries.blueprint:0.3.1]
>>         ........
>> Caused by: javax.management.InstanceAlreadyExistsException:
>> com.mycomp.mc.root:type=target,name=assets
>>
>>
>> So it seems karaf does not un-register my MBean first.
>>
>>
>> Note, and can use karaf shell to restart my bundle ( restart xyz), no
>> exception here.
>>
>>
>>  Is it a bug?
>>
>> No so, after restart, the bundle 'seems' to operate, but I dont really
>> know the ramifications are.
>>
>>
>> One of work around, I am thinking, is to move the MBEANs another
>> bundle so that it never get reload. If it is a bug, should I go for
>> the workaround?
>>
>>
>> Thanks
>>
>> -Dan
>
>
> --
> Jean-Baptiste Onofré
> [hidden email]
> http://blog.nanthrax.net
> Talend - http://www.talend.com