|Re: [equinox-dev] Is there a way to capture BundleExceptions?|
I also tried creating a FrameworkLog and returning it using an AdaptorHook as well, but no log entries are passed to it by the framework. I think this one is really just mean to be used by my own adaptor hook and will not receive log entries from other parts of the framework.
2010/8/16 Eduardo Born <nosachamos@xxxxxxxxx>Hi!
Thank you for your reply!
I have tried it, but I don't get FrameworkEvents for bundles not resolved due to missing constraints. To unsure I was registering the listener as soon as possible I created an AdaptorHook and registered the listener on the system bundle context within the startFramework method. I got one BundleException due to missing classpath entry for one of the bundles:
org.osgi.framework.BundleException: The bundle class path entry "runtime_registry_compatibility.jar" could not be found for the bundle "reference:file:/D:/eclipse/plugins/org.eclipse.equinox.registry_3.5.0.v20100503.jar"
...but for all non-resolved bundles there were not events raised.
I saw for example in Equinox's log entries like:
!MESSAGE Bundle reference:file:/D:/Scitec/automation/old tests/Target Platform/Third Party Plugins/plugins/org.hibernate_3.3.0.jar was not resolved.
!SUBENTRY 2 org.hibernate 2 0 2010-08-16 11:36:28.475
!MESSAGE Missing required bundle antlr_2.7.6.
Which I caused on purpose by removing bundle antlr_2.7.6 to test this error listening mechanisms. For this and other problems there were no framework events generated.
Any other ideas? I'll keep trying and will let you know if I find the answer, but at this point I'm running out of ideas where to look at.
I was able to capture one BundleException
2010/8/16 Fabian Pecher <fabian.pecher@xxxxxxxxxxxxxx>
have you looked into OSGi's own asynchronous FrameworkEventListener? If
you solely need to capture the BundleException, you should get it by
invoking FrameworkEvent.getThrowable() on ERROR events (yet, I haven't
tried it myself :) ).
Eduardo Born wrote:
> I'm developing on top of Equinox and couldn't find a way to capture or
> listen to BundleExceptions raised by the framework. More specifically, I
> want to capture bundle exceptions thrown when bundles cannot be resolved due
> to any cause, for example missing constraints. Later on, I'll display a
> dialog with all bundle exceptions to help me debug these issues.
> I've used equinox outside Eclipse and was able to capture all bundle
> exceptions there since I was the one discovering bundles, installing and
> starting some of them, but now that I'm lauching a product from within
> eclipse I can't find a way to listen for those exceptions... I've looked
> into adaptohooks but none of them seem to help.
> Please let me know how to accomplish this, I have looked into this
> extensively and would greatly appreciate any clues you might have.
> Thank you!
> Eduardo Born
> equinox-dev mailing list
equinox-dev mailing list