Support automatic lookup of containing bundlecontext when running in static/legacy mode