Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Exception not shown...
Exception not shown... [message #101540] Thu, 15 November 2007 15:32 Go to next message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Hi,

I frequently have the problem that if an exception happens in an Activator that bundle is simply not started. While I
understand that behaviour (exception in the start method), I don't understand why no message, no stacktrace (no nothing
so to say) is shown.

If I use the OSGi console (-console) and start the bundle than later with "start xx", I get a full blown nice exception
trace. I didn't ask for the exception to be supressed in the first case.

How can I disable that "feature" ?

thanks

christian campo
Re: Exception not shown... [message #101570 is a reply to message #101540] Thu, 15 November 2007 22:27 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Christian,

The exception should be logged to the error log. Do you not see any
errors there? The issue is when bundles are lazily activated on class
load there is no client available to propagate the exception to. Only
NoClassDefFoundErrors or ClassNotFoundExceptions are thrown at that point.

Another place this can happen is when the framework is launched and the
start-level is being incremented. At this point the framework is
activating the bundles. When an exception happens here it should be
logged to the error log also.

Tom.
Re: Exception not shown... [message #101580 is a reply to message #101570] Fri, 16 November 2007 08:34 Go to previous message
Christian Campo is currently offline Christian CampoFriend
Messages: 597
Registered: July 2009
Senior Member
Thanks Tom,
actually its correct that the exception gets logged to the error log. However if you for instance
start your app and say you have 10 bundles and 9 of them are started correctly and one does not want
to (for whatever reason), you see no problem or error on the console. So my point is why exception that
are basic are not shown in the eclipse ide console.

In the meantime I found out that this is driven by a fixed setting in Debug.DEBUG_GENERAL. If you change
the default setting from false to true, these bundle start errors are shown in the console. (among other things)

You can either change that value in an early Activator (early in the sense of in an early startlevel) or you check
out org.eclipse.osgi into your workspace and change that property.

I believe it is pretty unfortunate that you cannot drive this behaviour with a parameter in your application start. (or
that it is not on by default if you start your application in the IDE i.e. in the debug mode)

Actually you are right with the error log, just that I didn't look at it all the time in the past because sometimes
(especially in my case where I work with OSGi Services a lot where not all bundles have a direct dependency) the
application comes up, just that some bundles are not running.

Thanks for your help
Christian.


Tom Watson schrieb:
> Hi Christian,
>
> The exception should be logged to the error log. Do you not see any
> errors there? The issue is when bundles are lazily activated on class
> load there is no client available to propagate the exception to. Only
> NoClassDefFoundErrors or ClassNotFoundExceptions are thrown at that point.
>
> Another place this can happen is when the framework is launched and the
> start-level is being incremented. At this point the framework is
> activating the bundles. When an exception happens here it should be
> logged to the error log also.
>
> Tom.
Previous Topic:Did somebody use JUnit to test OSGi application?
Next Topic:Developing application using Equinox + Swing under Mac OS X
Goto Forum:
  


Current Time: Thu Apr 18 23:25:42 GMT 2024

Powered by FUDForum. Page generated in 0.01904 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top