Karaf assembly omits extra system packages ( javax.annotation two dependency chains)


An occasional (race condition) Karaf assembly causes missing javax.annotation lines in the generated config.properties. This results in a dual dependency chain error when Opencast modules are loaded at startup.

Workaround: Rebuild the assembly again and check the generated config.properties for the missing lines.

Long Term: Karaf 4.2 has a different assembly strategy and may avoid this issue (OC currently on Karaf 4.0.10). KARAF-4996 appears to track this issue.

The error from the logs (message-broker-api is the first to load with the dependency on javax.annotation). This causes modules with a dependency on message-broker to not load.

One can provoke the error on the worker or the presentation node when the following lines are deleted in the correct config.properties.

Missing extra system packages from Karaf assembled etc/config.properties file:

The 7 javax.annotation-api class dependencies in Opencast modules (another project in github implemented a different Null check class to avoid the annotation-api all together because of this issue).

I believe this ticket tracks the issue: https://issues.apache.org/jira/browse/KARAF-4996.

KARAF-4996 was thought to be solved in Karaf 4.1.1, but the ticket has been re-opened. An older ticket partially solved the original issue and is probably related to the current issue: https://issues.apache.org/jira/browse/KARAF-3722. The karaf tooling is reworked in Karaf 4.2.0 and may avoid race conditions in building the "org.osgi.framework.system.packages.extra" listing in the generated config.properties.




Karen Dolan

Tags (folksonomy)



Fix versions

Affects versions