org.osgi.framework.BundleException:缺少需求[260.0]包; (&(package = javax.mail.internet)(version> = 1.5.0)(!(version> = 2.0.0)))

时间:2014-03-11 16:53:10

标签: maven osgi bundle apache-camel apache-karaf

我在karaf中安装custum jar时遇到此异常 install -s mvn:com.cgi.horizo​​n / myjar / 0.0.1

org.osgi.framework.BundleException:捆绑包XXXX中的未解决约束[260]:无法解析260.0:缺少需求[260.0]包; (及(包 = javax.mail.internet)(版本> = 1.5.0)((版本>!= 2.0.0)))

据我所知,已经安装了一些javax.mail,版本不同。但1.5.0是最新的! 我输入1.5,系统似乎有2.0.0。我不知道它来自哪里 导出命令给出1.4

有人可以帮助我吗? 谢谢

这就是我所拥有的:

我的pom:

<build>
  <finalName>${project.artifactId}</finalName>
  <plugin
  <plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>2.3.2</version>
  <configuration>
  <source>1.7</source>
  <target>1.7</target>
  </configuration>
  </plugin>
  <plugin>
  <groupId>org.apache.felix</groupId>
  <artifactId>maven-bundle-plugin</artifactId>
  <version>2.3.6</version>
  <extensions>true</extensions>
  <configuration>
  <instructions>
  <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
  <Import-Package>*</Import-Package>
  </instructions>
  </configuration>
  </plugin>
  </plugins>
  </build>

  <properties>
  <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
  <dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>3.8.1</version>
  <scope>test</scope>
  </dependency>
  <dependency>
  <groupId>javax.mail</groupId>
  <artifactId>mail</artifactId>
  <version>1.5.0-b01</version>
  </dependency>
  <dependency>
  <groupId>org.springframework.data</groupId>
  <artifactId>spring-data-mongodb</artifactId>
  <version>1.3.3.RELEASE</version>
  <scope>provided</scope>
  </dependency>
  <dependency>
  <groupId>org.codehaus.jackson</groupId>
  <artifactId>jackson-jaxrs</artifactId>
  <version>1.9.13</version>
  <scope>provided</scope>
  </dependency>
  <dependency>
  <groupId>org.apache.camel</groupId>
  <artifactId>camel-cxf</artifactId>
  <version>2.12.2</version>
  <scope>provided</scope>
  </dependency>
  </dependencies>
</project>

我的清单:

    Manifest-Version: 1.0
Bnd-LastModified: 1394496459530
Build-Jdk: 1.6.0_43
Built-By: lprevost
Bundle-ManifestVersion: 2
Bundle-Name: horizon-util
Bundle-SymbolicName: horizon-util
Bundle-Version: 0.0.1
Created-By: Apache Maven Bundle Plugin
Export-Package: com.cgi.horizon.util;uses:="org.springframework.data.mon
 godb.core.mapping,org.springframework.data.annotation,org.springframewo
 rk.data.mongodb.core,org.springframework.beans.factory.annotation,org.s
 pringframework.data.mongodb.core.query,com.mongodb,org.springframework.
 stereotype";version="0.0.1",com.cgi.horizon.util.log;uses:="com.cgi.hor
 izon.util";version="0.0.1",com.cgi.horizon.util.mailer;uses:="com.cgi.h
 orizon.util,javax.mail.internet,javax.mail";version="0.0.1",com.cgi.hor
 izon.util.mongo;uses:="org.apache.cxf.jaxrs.client,org.codehaus.jackson
 .jaxrs,org.codehaus.jackson.map,org.springframework.stereotype,javax.ws
 .rs.core";version="0.0.1"
Import-Package: com.mongodb;version="[2.10,3)",javax.mail;version="[1.4.
 0,2.1.0)",javax.mail.internet;version="[1.5,2)",javax.ws.rs.core;versio
 n="[2.0,3)",org.apache.cxf.jaxrs.client;version="[2.7,3)",org.codehaus.
 jackson.jaxrs;version="[1.9,2)",org.codehaus.jackson.map;version="[1.9,
 2)",org.springframework.beans.factory.annotation;version="[3.1,4)",org.
 springframework.data.annotation;version="[1.6,2)",org.springframework.d
 ata.mongodb.core;version="[1.3,2)",org.springframework.data.mongodb.cor
 e.mapping;version="[1.3,2)",org.springframework.data.mongodb.core.query
 ;version="[1.3,2)",org.springframework.stereotype;version="[3.1,4)"
Tool: Bnd-1.50.0



DynamicImport-Package =
        *
Import-Package =
        com.mongodb;version="[2.10,3)",
        javax.mail;version="[1.5,2)",
        javax.mail.internet;version="[1.5,2)",
        javax.ws.rs.core;version="[2.0,3)",
        org.apache.cxf.jaxrs.client;version="[2.7,3)",
        org.codehaus.jackson.jaxrs;version="[1.9,2)",
        org.codehaus.jackson.map;version="[1.9,2)",
        org.springframework.beans.factory.annotation;version="[3.1,4)",
        org.springframework.data.annotation;version="[1.6,2)",
        org.springframework.data.mongodb.core;version="[1.3,2)",
        org.springframework.data.mongodb.core.mapping;version="[1.3,2)",
        org.springframework.data.mongodb.core.query;version="[1.3,2)",
        org.springframework.stereotype;version="[3.1,4)"
Export-Package =
        com.cgi.horizon.util;
                uses:="org.springframework.data.mongodb.core.mapping,
                        org.springframework.data.annotation,
                        org.springframework.data.mongodb.core,
                        org.springframework.beans.factory.annotation,
                        org.springframework.data.mongodb.core.query,
                        com.mongodb,
                        org.springframework.stereotype";
                version=0.0.1,
        com.cgi.horizon.util.log;uses:=com.cgi.horizon.util;version=0.0.1,
        com.cgi.horizon.util.mailer;uses:="com.cgi.horizon.util,javax.mail.internet,javax.mail";version=0.0.1,
        com.cgi.horizon.util.mongo;
                uses:="org.apache.cxf.jaxrs.client,
                        org.codehaus.jackson.jaxrs,
                        org.codehaus.jackson.map,
                        org.springframework.stereotype,
                        javax.ws.rs.core";
                version=0.0.1

karaf@root> exports|grep javax.mail
   109 javax.mail.internet; version=1.4.0
   109 javax.mail.util; version=1.4.0
   109 javax.mail.search; version=1.4.0
   109 javax.mail; version=1.4.0
   109 javax.mail.event; version=1.4.0


karaf@root> exports|grep mail
    72 org.springframework.mail; version=3.0.7.RELEASE
    72 org.springframework.mail.javamail; version=3.0.7.RELEASE
   109 javax.mail.internet; version=1.4.0
   109 javax.mail.util; version=1.4.0
   109 javax.mail.search; version=1.4.0
   109 javax.mail; version=1.4.0
   109 javax.mail.event; version=1.4.0
   109 com.sun.mail.imap; version=1.4.5
   109 com.sun.mail.imap.protocol; version=1.4.5
   109 com.sun.mail.iap; version=1.4.5
   109 com.sun.mail.pop3; version=1.4.5
   109 com.sun.mail.smtp; version=1.4.5
   109 com.sun.mail.util; version=1.4.5
   109 com.sun.mail.util.logging; version=1.4.5
   109 com.sun.mail.handlers; version=1.4.5
   235 org.apache.camel.component.mail; version=2.10.7

1 个答案:

答案 0 :(得分:0)

首先需要在Karaf中安装java mail 1.5,以便它可用于您的捆绑包。