If you DON'T install a log service, the errors are actually printed to the console.
If you DO have a log service then just use the command “log <level>” to list the most recent log entries at that level or above. For example “log warn” will give all the warnings and errors but not info or debug. This has a small advantage over printing to the console because you can show the entries at any time rather than scrolling back to when they happened. Regards, Neil > On 4 Aug 2016, at 20:29, [email protected] wrote: > > Hello. > > I have a simple declarative service such as: > > --8<-- > @Component(immediate = true) > public final class Speaker implements SpeakerType > { > public Speaker() > { > System.out.println("Speaker (declarative): constructor"); > } > > @Activate > private void onActivate() > { > System.out.println("Speaker (declarative): onActivate"); > } > > @Override > public void speak(final String text) > { > System.out.println("Speaker (declarative): speak: " + text); > } > } > -->8-- > > If I throw an exception in either the constructor or the onActivate() > method, I get no indication that this has happened. A quick search > through the core spec for the word "exceptions" leads me to 9.3.6, > which I think may be relevant even though I'm going through the > declarative services service: > > If the BundleActivator.start or stop method throws an Exception, then > the handling of this Exception is different depending who invoked > the start or stop method. > > If the bundle is started/stopped due to a change in the active start > level or the bundle's start level, then the Exception must be wrapped > in a BundleException and broadcast as a FrameworkEvent.ERROR event. > Otherwise, a new BundleException must be created containing the > exception and this BundleException is then thrown to the caller. > > So I assume that I need to register some sort of listener to receive > errors. However, even assuming that I do this: What if the exception is > of a type that the listener does not import? > > Is there a bundle in the distribution that handles this? I have the Log > service installed, but that doesn't appear to do anything (unless it > requires extra configuration - I've not given it any). I just > want errors logged to the console during development so that I don't > sit here trying to debug silent failures. > > M --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

