Rate this page:
A plugin fails to load at runtime, and the log contains an with a as its root cause. For example:
WARNING: Unable to enable plugin 'com.atlassian.myplugin.my-plugin' com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.atlassian.myplugin.my-plugin at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:385) at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:212) ... Caused by: org.osgi.framework.BundleException: Unable to resolve due to constraint violation. at org.apache.felix.framework.Felix._resolveBundle(Felix.java:1732) at org.apache.felix.framework.Felix._startBundle(Felix.java:1588) at org.apache.felix.framework.Felix.startBundle(Felix.java:1541) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:371)
If your plugin is failing to enable with the message "Unable to resolve due to constraint violation." but doesn't specify a particular package or what the constraint violation is, it's possible that the exporter of a package that you are importing is imposing a constraint directive that your plugin is not satisfying. You may need to add a <Package-Import> to your own plugin to satisfy this directive.
At the moment, determining which bundle imposes a constraint is primarily guesswork. You will need to look through the files of bundles from which you are importing packages looking for directives in the section.
Manifest-Version: 1.0 Export-Package: com.pyxis.greenhopper;uses:="javax.xml.bind.annotation";version:="4.3.1" Import-Package: javax.xml.bind.annotation;version="2.1.0"
The implies that plugins importing both and must import version "2.1.0" of . This can be achieved by adding the relevant to your :
<build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration> <instructions> <Import-Package> javax.xml.bind*;version="2.1.0", <!-- note the specified version String --> * </Import-Package> <Spring-Context>*;timeout:=60</Spring-Context> </instructions> </configuration> </plugin> </plugins> </build>
Rate this page: