当我尝试在Apache Felix上启动我的OSGI包时,我收到以下错误消息:
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)
它使用jira-rest-cleint OSGI包:
<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>
此外,Apache Felix的所有需求包和捆绑包都处于活动模式:
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)
答案 0 :(得分:0)
问题解决了,当我手动重建这个依赖项并在其中注入所需的版本guava时。