Found my problem. Very sorry.


On Fri, Apr 25, 2014 at 8:42 AM, Keith Hughes <[email protected]>wrote:

> Hi folks,
>
> I have a strange bug and suspect it may be due to bundle startup order in
> Felix.So I am trying to log bundle startup order. I tried adding a bundle
> listener to the Framework object before starting it and see nothing being
> logged at all.
>
> My code looks like this:
>
>     framework = getFrameworkFactory().newFramework(m);
>     frameworkStartLevel = framework.adapt(FrameworkStartLevel.class);
>
>     framework.init();
>     rootBundleContext = framework.getBundleContext();
>     rootBundleContext.addBundleListener(new BundleListener() {
>       @Override
>       public void bundleChanged(BundleEvent event) {
>         try {
>           System.out.println(event.getType());
>           if (event.getType() == BundleEvent.STARTED) {
>             Bundle bundle = event.getBundle();
>             System.out.println(
>                 String.format("Bundle %s:%s started",
> bundle.getSymbolicName(), bundle.getVersion()));
>           }
>         } catch (Exception e) {
>           // TODO Auto-generated catch block
>           e.printStackTrace();
>         }
>       }
>     });
>
> I then later add bundles and start them and yet never see a peep.
>
> Any ideas?
>
> Thanks,
> -Keith
>
>

Reply via email to