NPE when annotations bundle found but not active
bundle.getBundleContext() will give an NPE (in Equinox) if the bundle can be found but is not active.
Would also be good to at least log the exception in debug mode to point to a possible problem.
@@ -47,6 +47,9 @@ public class OsgiSwaggerUiResolver extends SwaggerUiResolver {
if (bundle == null) {
return null;
}
+ if (bundle.getState() != Bundle.ACTIVE) {
+ bundle.start();
+ }
String[] locations = swaggerUiMavenGroupAndArtifact == null ? DEFAULT_LOCATIONS
: new String[]{"mvn:" + swaggerUiMavenGroupAndArtifact + "/",
"wrap:mvn:" + swaggerUiMavenGroupAndArtifact + "/"};
