[OsgiPlugin] Detected an error (BundleException) enabling the plugin

Jason Huntley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 25, 2013

I'm encountering the following plugin during testing for the latest release of Bamboo:

2013-09-26 13:36:08,598 ERROR [main] [OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.houghtonassociates.bamboo.plugins.gReview' : Constraint violation for package 'org.springframework.dao' when resolving module 66.0 between existing import 0.org.springframework.dao BLAMED ON [[66.0] package; (&(package=org.springframework.dao)(version>=0.0.0)(version<=0.0.0))] and uses constraint 4.0.org.springframework.dao BLAMED ON [[66.0] package; (package=hudson.model), [27.0] package; (package=org.springframework.dao)]. This error usually occurs when your plugin imports a package from another bundle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see http://confluence.atlassian.com/x/1xy6D

I'm trying to resolve the issue above, investigate it further. However, the link the error references is dead. Any idea what this is referring too?

Nevermind, i found the link:

https://jira.atlassian.com/browse/CONF-26094

The new link resides here:

https://developer.atlassian.com/display/DOCS/BundleException

As for the exception, I can't find this package anywere inmy plugin. Why am I getting this exception? I've read the doc and it still doesn't make sense. Here are my pom.xml and atlassian-plugin.xml:

https://github.com/onepremise/gReview/blob/master/pom.xml

https://github.com/onepremise/gReview/blob/master/src/main/resources/atlassian-plugin.xml

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Jason Huntley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2013

Ok, finally, figured out the issue. I had the incorrect OSGI markup in my atlassian-plugin.xml. Here's what I had:

1
2
3
4
5
<bundle-instructions>
<Import-Package>com.atlassian.bamboo.plugins.git;resolution:=optional;version="[1.8.26,1.9.9]"</Import-Package>
<Import-Package>com.sonyericsson.hudson.plugins.gerrit;resolution:=optional;version="[1.2.7,1.3.1]"</Import-Package>
<Import-Package>*;resolution:=optional</Import-Package>
</bundle-instructions>

Here's what the markup should be:

1
2
3
4
5
6
7
8
9
<bundle-instructions>
<Import-Package>
com.atlassian.bamboo.plugins.git;resolution:=optional;version="[1.8.26,2.5.8]",
com.sonyericsson.hudson.plugins.gerrit;resolution:=optional;version="[1.2.7,1.5.2]",
com.houghtonassociates.bamboo.plugins.view.*,com.atlassian.bamboo.ww2.actions.chains.*;resolution:=optional,
com.atlassian.bamboo.webrepository.*,com.atlassian.bamboo.ww2.aware.*,org.apache.log4j;resolution:=optional,
com.atlassian.bamboo.v2.build.repository.*;resolution:=optional
</Import-Package>
</bundle-instructions>

There only needs to be one <import-package> element used. Separate entries by comma.

Good reference for details regarding importing and exporting packages:http://fusesource.com/docs/esb/4.4/esb_deploy_osgi/BestPractices-BuildBundles.html

0 votes
Jason Huntley
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 26, 2013
TAGS
AUG Leaders

Atlassian Community Events