Search code examples
osgiapache-felixdeclarative-services

Can an OSGi fragment bundle publish a declarative service?


I have a fragment bundle that I created to access some add functionality to a second-party jar. My fragment should register a service to expose this new functionality. It doesn't seem to work. Before I get deep into troubleshooting, I'd like to know if this is even allowed? That is, does Felix SCR's bundle watcher look at or ignore fragments?


Solution

  • Aha, I found the answer myself in the spec, section 112.4.2: "A Service-Component manifest header specified in a fragment is ignored by SCR." This is consistent with 3.14.3: "The following list contains the headers that must not be used in a fragment bundle: Bundle-Activator"