[ https://issues.apache.org/jira/browse/FELIX-6510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17741856#comment-17741856 ]
Heiko Studt commented on FELIX-6510: ------------------------------------ As the manifest file does not contain any OSGI headers, the default manifest version "1" is assumed and therefore the symbolic name is allowed to be null - which in turn crashes the bundles health check. However, according to spec 3, all manifest headers are optional and assumed empty if not set. In my ignorance, I would assume that it does not make sense to install any non-osgi jar and all but very few are nowadays built against R4+. Then, the framework may disallow not setting the symbolic name for any manifest version, though violating the R3 spec. > NPE within HealthCheck BundlesStartedCheck for bad Bundle > --------------------------------------------------------- > > Key: FELIX-6510 > URL: https://issues.apache.org/jira/browse/FELIX-6510 > Project: Felix > Issue Type: Improvement > Components: Health Checks > Reporter: Heiko Studt > Priority: Major > Fix For: healthcheck.generalchecks 3.0.8 > > > TL;DR: If you have configured the BundlesStartedCheck and there was any > bundle installed without correct OSGI headers (ls is showing `null 0.0.0`), > the BundlesStartedCheck will report some NPE and does not log anything to > file and neither the reason nor a stack trace into the health-check frontend. > The latter (no stack-trace) is a good thing, though. > If you have switched on the debug-level "all", it will stop after some lines > "Bundle [...] not matched by [...]"; the exception itself is then swallowed > and not logged into the osgi runner log, so that one has to wonder why it has > happened. > In my osgi runner there was a bundle installed which was shown by "ls -l" as > "null 0.0.0". It was created from an unit-test jar included by an error. > According to removing that bundle is solving the problem, I assume the > following code is the culprit. > [https://github.com/apache/felix-dev/blob/5becb8f971f904334eb3f32e7eaa9126186a2898/healthcheck/generalchecks/src/main/java/org/apache/felix/hc/generalchecks/BundlesStartedCheck.java#L149] > b.getHeaders().get(Constants.BUNDLE_ACTIVATIONPOLICY) > In my point of view, we should add a null check for b.getHeader() or at least > report the culprit bundle name of the exception. > Should I create a Pull Request for the null check? -- This message was sent by Atlassian Jira (v8.20.10#820010)