Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Dependency problem when starting Bitbucket plugin

magnlun January 21, 2016

I have tried to create a new Bitbucket plugin. The plugin seems to work fine when I try it out in eclipse. However when I try to start it with atlas-debug I get this log:

[INFO] [talledLocalContainer] Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.aphelion.fix.version.pusher.fix-version-pusher [103]: Unable to resolve 103.0: missing requirement [103.0] package; (package=COM.jrockit.reflect)

[INFO] [talledLocalContainer]     at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3564) ~[Felix.class:na]

[INFO] [talledLocalContainer]     ... 19 common frames omitted

 

 What can cause this and how can I solve it?

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2016

The error indicates that while building your plugin, the maven-amps plugin detected that your code uses/depends on a class from the com.jrockit.reflect package. As a result, it injected an OSGI Package-Import instruction for that package in the META-INF/MANIFEST.MF file.

What surprises me is that you get that dependency at all. Are you by chance compiling (and running) using a JRockit JVM? If so, try to switch to the Oracle JVM or OpenJDK JVM. Note that the JRockit JVM is not supported (see https://confluence.atlassian.com/display/BitbucketServer/Supported+platforms).

If you are not using JRockit, one of your dependencies is pulling it in. You can check that by running mvn dependency:tree from the root of your plugin and search for jrockit.

magnlun January 21, 2016

I have just installed the Oracle JVM, however is it possible that the Atlassian compile uses a different JVM than my main one? Can I check that?. The Maven tree didn't display the package, however the startup displays this:

[WARNING] The manifest should contain versions for all imports to prevent ambiguity at install time due to multiple versions of a package.  Here are some suggestions for the maven-stash-plugin configuration generated for this project to start from:
   <configuration>
    <instructions>
      <Import-Package>
        javax.crypto;version="0.0.0",
        sun.reflect;version="0.0.0",
        javax.security.auth.x500;version="0.0.0",
        org.slf4j;version="0.0.0",
        javax.naming;version="0.0.0",
        jrockit.vm;version="0.0.0",
        org.apache.oro.text.regex;version="0.0.0",
        org.joda.convert;version="0.0.0",
        javax.naming.directory;version="0.0.0",
        nu.xom;version="0.0.0",
        COM.jrockit.reflect;version="0.0.0",
        groovy.lang;version="0.0.0",
        javax.naming.ldap;version="0.0.0",
        org.ietf.jgss;version="0.0.0",
        com.atlassian.stash.*;version="0.0.0",
        com.google.common.collect;version="0.0.0",
        javax.crypto.spec;version="0.0.0",
        org.codehaus.groovy.r*;version="0.0.0",
        org.apache.avalon.framework.logger;version="0.0.0",
        javax.servlet;version="0.0.0",
        javax.net;version="0.0.0",
        javax.net.ssl;version="0.0.0",
        org.apache.log;version="0.0.0",
        org.apache.log4j;version="0.0.0",
        org.apache.tools.ant*;version="0.0.0",
        sun.security.util;version="0.0.0",
        javax.inject;version="0.0.0"
      </Import-Package>
    </instructions>
  </configuration>
You may notice many packages you weren't expecting.  This is usually because of a bundled jar that references packages that don't apply.  You can usually remove these or if necessary, mark them as optional by adding ';resolution:=optional' to the package import.  Packages that are detected as version '0.0.0' usually mean either they are JDK packages or ones that aren't referenced in your project, and therefore, likely candidates for removal entirely.

 

Michael Heemskerk
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2016

Atlassian AMPS will not install a different JVM and should use the standard JVM. You can check which JVM you're using by running java -version on the command line.

If that turns out to be the Oracle JVM, can you post the dependencies you have listed in your pom?

magnlun January 21, 2016

java -version

java version "1.8.0_66"

Java(TM) SE Runtime Environment (build 1.8.0_66-b17)

Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

 The pom dependencies:

    <dependencies>

        <dependency>

            <groupId>com.atlassian.stash</groupId>

            <artifactId>stash-api</artifactId>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>com.atlassian.stash</groupId>

            <artifactId>stash-spi</artifactId>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>com.atlassian.stash</groupId>

            <artifactId>stash-page-objects</artifactId>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>javax.servlet-api</artifactId>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>net.rcarz</groupId>

            <artifactId>jira-client</artifactId>

        </dependency>

    </dependencies>

 

0 votes
Mibex_Software
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.
January 21, 2016

Hi,

You could import it as optional for bnd in our pom.xml and hope that it is not used in your plug-in or any of your dependencies:

&lt;Import-Package&gt;

COM.jrockit.*;resolution:=optional

Hope this helps,

Michael

 

 

 

 

 

 

magnlun January 21, 2016

That would probably help me, if I understood it smile.

  1. What do you mean your pom.xml? Where is that located? I'm guessing it's not the same as the plugins pom.xml?
  2. Where in the pom.xml should I add that? (in what part of the xml tree?)
Mibex_Software
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.
January 21, 2016
&lt;plugins&gt;
&lt;plugin&gt;
&lt;groupId&gt;com.atlassian.maven.plugins&lt;/groupId&gt;
&lt;artifactId&gt;bitbucket-maven-plugin&lt;/artifactId&gt;
&lt;extensions&gt;true&lt;/extensions&gt;
&lt;configuration&gt;
&lt;instructions&gt;
&lt;Import-Package&gt;
COM.jrockit.*;resolution:=optional
&lt;/Import-Package&gt;
&lt;/configuration&gt;
    &lt;/plugin&gt;
&lt;/plugins&gt;
Mibex_Software
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.
January 21, 2016

Hope that helps. You should already have such a section in your plug-ins pom.xml.

 

magnlun January 22, 2016

Hi!

Thank you, I tried this however the dependency still popped up in the start

TAGS
AUG Leaders

Atlassian Community Events