java—缺少需求osgi.willing.package(&(osgi.willing.package=org.osgi.framework)(版本>=1.10.0)((版本>=2.0.0)))

cdmah0mi  于 2021-08-25  发布在  Java
关注(0)|答案(0)|浏览(304)

这是我第一个尝试使用karaf和osgi容器的项目。
最新版本的osgi.framework是1.10.0,它必须适合。库中有osgi.framework包,manifest.mf有一行

"Export-Package: org.osgi.dto;version="1.1.1",org.osgi.framework;versio
 n="1.10""

启动捆绑包时出现错误:

bundle:start 55
Error executing command: Error executing command on bundles:
        Error starting bundle 55: Unable to resolve SuccessFactorsIntegration [55](R 55.0): missing requirement [SuccessFactorsIntegration [55](R 55.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.10.0)(!(version>=2.0.0))) Unresolved requirements: [[SuccessFactorsIntegration [55](R 55.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.10.0)(!(version>=2.0.0)))]

pom.xml

<modelVersion>4.0.0</modelVersion>
<groupId>by.MVasilevskiy</groupId>
<artifactId>SuccessFactorsIntegration</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>SuccessFactorsIntegration</name>
<packaging>bundle</packaging>

<dependencies>
    <dependency>
      <groupId>org.osgi</groupId>
      <artifactId>osgi.core</artifactId>
      <version>8.0.0</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-core</artifactId>
    <version>3.4.0</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>5.1.2</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>
                        ${project.artifactId}
                    </Bundle-SymbolicName>
                    <Bundle-Name>
                        ${project.name}
                    </Bundle-Name>
                    <Bundle-Version>
                        ${project.version}
                    </Bundle-Version>
                    <Bundle-Activator>
                        ${project.groupId}.Activator
                    </Bundle-Activator>
                    <Private-Package>
                        ${project.groupId}
                    </Private-Package>
                </instructions>
            </configuration>
        </plugin>
    </plugins>
</build>
<properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>

user.m2\repository\by\mvasilevskiy\successfactorsintegration\0.0.1-snapshot中的manifest.mf

Created-By: Apache Maven Bundle Plugin
Export-Package: by.MVasilevskiy;uses:="org.apache.camel.builder,org.osgi.fra
 mework";version="0.0.1.SNAPSHOT",by.MVasilevskiy.processor;uses:="org.apach
 e.camel";version="0.0.1.SNAPSHOT"
Import-Package: by.MVasilevskiy,by.MVasilevskiy.processor,javax.xml.namespace,ja
 vax.xml.parsers,javax.xml.xpath,org.apache.camel;version="[3.4,4)",org.
 apache.camel.builder;version="[3.4,4)",org.apache.camel.impl;version="[
 3.4,4)",org.apache.camel.model;version="[3.4,4)",org.osgi.framework;ver
 sion="[1.10,2)",org.w3c.dom
Require-Capability: osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=11))"
Tool: Bnd-5.1.1.202006162103

部分 org.osgi.framework.system.packages 从…起 config.properties ```

Framework config properties.

org.osgi.framework.system.packages=
org.osgi.dto;version="1.1",
org.osgi.resource;version="1.0",
org.osgi.resource.dto;version="1.0";uses:="org.osgi.dto",
org.osgi.framework;version="1.9",
org.osgi.framework.dto;version="1.9";uses:="org.osgi.dto",
org.osgi.framework.hooks.bundle;version="1.1";uses:="org.osgi.framework",
org.osgi.framework.hooks.resolver;version="1.0";uses:="org.osgi.framework.wiring",
org.osgi.framework.hooks.service;version="1.1";uses:="org.osgi.framework",
org.osgi.framework.hooks.weaving;version="1.1";uses:="org.osgi.framework.wiring",
org.osgi.framework.launch;version="1.2";uses:="org.osgi.framework",
org.osgi.framework.namespace;version="1.1";uses:="org.osgi.resource",
org.osgi.framework.startlevel;version="1.0";uses:="org.osgi.framework",
org.osgi.framework.startlevel.dto;version="1.0";uses:="org.osgi.dto",
org.osgi.framework.wiring;version="1.2";uses:="org.osgi.framework,org.osgi.resource",
org.osgi.framework.wiring.dto;version="1.3";uses:="org.osgi.dto,org.osgi.resource.dto",
org.osgi.service.condpermadmin;version="1.1.1";uses:="org.osgi.framework,org.osgi.service.permissionadmin",
org.osgi.service.packageadmin;version="1.2";uses:="org.osgi.framework",org.osgi.service.permissionadmin;version="1.2",
org.osgi.service.resolver;version="1.1";uses:="org.osgi.resource",
org.osgi.service.startlevel;version="1.1";uses:="org.osgi.framework",
org.osgi.service.url;version="1.0",
org.osgi.util.tracker;version="1.5.2";uses:="org.osgi.framework",
org.apache.karaf.version;version="4.3.2",
org.apache.karaf.jaas.boot.principal;uses:=javax.security.auth;version="4.3.2",
org.apache.karaf.jaas.boot;uses:="javax.security.auth,javax.security.auth.callback,javax.security.auth.login,javax.security.auth.spi,org.osgi.framework";version="4.3.2",
org.apache.karaf.info;version="4.3.2",
${jre-${java.specification.version}}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题