The Smart Data Blog

Resolving OSGi "Uses Constraint Violations" Using Anzo

Posted by Aron Lurie on Aug 10, 2015 7:45:00 PM

Summary

In large Java projects that use OSGi, there can arise a well-defined problem known as a "uses constraint violation". This problem arises when the classes available to a certain bundle - its class space - contains two versions of the same package. An OSGi system's bundles, packages, and dependencies can be modeled as a graph inside of Anzo Smart Data Platform (Anzo SDP), thus providing a framework for visualization and complex analysis. This article provides multiple methods for using this framework to determine the class space of a bundle. It also provides a SPARQL query and technique for determining the causes and possible solutions of a uses constraint violation, and discusses a concrete example.

Read More

Topics: Anzo, OSGi