[
https://issues.apache.org/jira/browse/FELIX-4178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15295476#comment-15295476
]
Christoph Läubrich commented on FELIX-4178:
---
Sorry for the confusion, in fact this improvement contains two failing-cases as
described in the initial request:
# "exception a component throws in the activate method": This can happen in
production/testing/... e.g. if any thing is going bad while the component tries
to get active
and
# "any exception while try to create instance": This (in most cases) should
only happen in development, but is handy also to include in the current state
so it can be queried
as [~magnet] wrote, the demaind is mainly to make the cause of the failing
accessible together with the FAILED state, regardless of case 1 or case 2 since
other tools/api can then build up this (e.g. equinox-ds provide the exception
cause with there comp-command), in my particular case I have two use-case where
this would be very handy:
* I wrote an "diag-comp" command that print out taking a given component why
this is not satisfied by traversing all dependecies and telling what needs to
be fullfilled and what other components/bundles might be able to fullfill a
given requirement. Since the component to fullfill a requirement might has
other dependencies this can result in a complete chain and if one of them has
FAILING state this is in most cases the root of the problem (given a
system-configuration that can be satisfied at all) and giving the used the
reason why the component failed would be very usefull. Since this is called
just on-demand it has no internal state and only queries the API for current
state.
* I also made component state available via JMX (name, id and state) so tools
like nagios can produce alerts (either direct or by sending mails and so on...)
and if I can include the exception here it would also help so one has not to
connect to the system and grep some log-files to find out what might has cause
the component to fail.
> Provide method to access Exception thrown by activate method and/or while
> instantiation
> ---
>
> Key: FELIX-4178
> URL: https://issues.apache.org/jira/browse/FELIX-4178
> Project: Felix
> Issue Type: Improvement
> Components: Declarative Services (SCR)
>Reporter: Christoph Läubrich
>Assignee: David Jencks
>
> Access to the exception a component throws in the activate method or any
> exception while try to create instance (e.g. no default constructer, class
> not found...) would help for diagnostic tools depending on the ScrService.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)