Search code examples
guavaaemapache-felixjira-rest-java-api

com.google.common.base.Function not found by com.atlassian.jira.rest.client


When i try to start my OSGI bundle on Apache Felix, I get the error message below:

2.08.2015 20:03:19.853 *ERROR* [qtp1891880671-970]           
org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Activator start error in bundle com.jirachecker.jirachecker-bundle [414].)
...
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: com/google/common/base/Function
at com.atlassian.jira.rest.client.internal.async.AsynchronousHttpClientFactory.createClient(AsynchronousHttpClientFactory.java:53)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.create(AsynchronousJiraRestClientFactory.java:35)
at com.atlassian.jira.rest.client.internal.async.AsynchronousJiraRestClientFactory.createWithBasicHttpAuthentication(AsynchronousJiraRestClientFactory.java:42)
at com.jirachecker.impl.JiraRestServiceImpl.<init>(JiraRestServiceImpl.java:34)
at com.jirachecker.Activator.start(Activator.java:19)

It uses jira-rest-cleint OSGI bundle:

<dependency>
    <groupId>org.openengsb.wrapped</groupId>
    <artifactId>jira-rest-java-client-api</artifactId>
    <version>2.0.0-m32.w1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.openengsb.wrapped</groupId>
    <artifactId>jira-rest-java-client-core</artifactId>
    <version>2.0.0-m32.w1</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.openengsb.wrapped</groupId>
    <artifactId>jira-rest-java-client-plugin</artifactId>
    <version>2.0.0-m32.w1</version>
    <scope>provided</scope>
</dependency>

Also, Apache Felix has all needs packages and bundles is in active mode:

com.adobe.cq.sightly,version=2.2.0 from com.adobe.cq.sightly.cq-wcm-sightly-extension (372)
com.atlassian.jira.rest.client.api,version=2.0.0.m31w2 from com.atlassian.jira.rest.client (399)
...
com.atlassian.util.concurrent,version=2.4.0.M9 from com.atlassian.jira.rest.client (399)
com.google.common.annotations,version=14.0.1 from com.google.guava (78)
com.google.common.base,version=14.0.1 from com.google.guava (78)
...
org.osgi.framework,version=1.6.0 from org.apache.felix.framework (0)
org.slf4j,version=1.7.6 from slf4j.api (14)

Solution

  • Problem solves, when i rebuild this dependencies manually and inject required version guava inside it.