문제

In the karaf console, if your bundle is wired with spring framework, listing the bundles will show the spring state. For example, see bundle 91 below. It's spring state is "FAILED".

Is there anyway to get this information via JMX karaf MBeans?

The MBean org.apache.karaf:type=bundles,name=SOMENAME/attribute=Bundles lists the osgi state for the bundles, but not the karaf state. There's a separate MBean for blueprint, but digging around I cannot find anything exposed that lists the spring state of a bundle.

   ID   State         Blueprint      Spring    Level  Name
[  91] [Active     ] [            ] [FAILED ] [   80] Foo Common Services (1.0.0)
[  92] [Active     ] [            ] [       ] [   80] Apache Felix Declarative Services (1.6.0)
[  93] [Active     ] [            ] [       ] [   80] Commons Codec (1.4)
[  94] [Active     ] [            ] [       ] [   80] Foo Crypto (1.0.0)
[  95] [Active     ] [            ] [       ] [   80] Commons Lang (2.6)
도움이 되었습니까?

해결책

In karaf 3 we unified the bundle state. There is only one state then that includes the blueprint and spring state. You can also call getDiag(bundleId) to get the error message of a failed spring bundle.

In karaf 2.x there is no such feature unfortunately.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top