首页 > 解决方案 > ResolutionException: Unable to resolve root: 缺少需求 [root] filter:="(osgi.wiring.package=javax.jws)(version>=1.1.0)(!(version>=2.0.0))

问题描述

当我尝试在 Fabric8 的容器上部署 7 个捆绑包中的 1 个时,出现下一个错误:

2021-06-29 15:24:41,239 | ERROR | dd741-1-thread-1 | DeploymentAgent                  | 83 - io.fabric8.fabric-agent - 1.2.0.redhat-133 | Unable to update agent
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=bundleinterface; type=karaf.feature; filter:="(&(osgi.identity=bundleinterface)(type=karaf.feature))" [caused by: Unable to resolve bundleinterface/0.0.0: missing requirement [bundleinterface/0.0.0] osgi.identity; osgi.identity=bundleproject-interface; type=osgi.bundle; version="[2.0.14.RELEASE,2.0.13.RELEASE]"; resolution:=mandatory [caused by: Unable to resolve bundleproject-interface/2.0.13.RELEASE: missing requirement [bundleproject-interface/2.0.13.RELEASE] osgi.wiring.package; filter:="(&(osgi.wiring.package=javax.jws)(version>=1.1.0)(!(version>=2.0.0)))"]]

关于我的 pom.xml 的信息:

<build>
<defaultGoal>install</defaultGoal>
<plugins>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
        <version>2.6</version>
        <configuration>
            <encoding>UTF-8</encoding>
        </configuration>
    </plugin>

    <!-- to generate the MANIFEST-FILE of the bundle -->
    <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.3.7</version>
        <extensions>true</extensions>
        <configuration>
            <instructions>
                <Bundle-SymbolicName>bundleproject-interface</Bundle-SymbolicName>
                <Export-Package>
                    com.bundleproject.interface.*,
                    com.bundleproject.interfaceimpl.*
                </Export-Package>
                <Import-Package>
                    org.apache.cxf.transport.http,
                    io.fabric8.cxf,                         
                    <!-- work around :: ini :: try to import the javax package but no work :( -->
                    <!-- javax.jws.*;version="[1.1.0, 2.0.0)", -->
                    javax.jws;version="[1.1.0,2.0.0)",
                    <!-- work around :: fin -->
                    *
                </Import-Package>
                <Import-Service>
                    com.bundleproject.service.LogService,
                    com.bundleproject.service.MessageFailService,
                    com.bundleproject.dsservice.IMsgLogService
                </Import-Service>
            </instructions>
        </configuration>
    </plugin>

</plugins>
<pluginManagement>
    <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings 
            only. It has no influence on the Maven build itself. -->
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>
                                    org.apache.cxf
                                </groupId>
                                <artifactId>
                                    cxf-codegen-plugin
                                </artifactId>
                                <versionRange>
                                    [3.0.1,)
                                </versionRange>
                                <goals>
                                    <goal>wsdl2java</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore></ignore>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>

我在用:

该项目之前部署在 Jboss Fuse 6.2.1 上并且运行良好。但是被 Fabric8 1.2.0.redhat-133 改变了

标签: javaosgi-bundlejbossfusefabric8maven-bundle-plugin

解决方案


推荐阅读