Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/335.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Maven:org.osgi.framework.BundleException:捆绑包中未解析的约束_Java_Maven - Fatal编程技术网

Java Maven:org.osgi.framework.BundleException:捆绑包中未解析的约束

Java Maven:org.osgi.framework.BundleException:捆绑包中未解析的约束,java,maven,Java,Maven,我正在从事一个maven项目,该项目有多个子项目,在子项目weasis核心ui中,我添加了一些JAR,我想在项目中使用这些JAR 我通过在weasis核心ui的pom.xml中添加依赖项实现了这一点:下面的代码包含了我正在使用的依赖项 pom.xml 请告诉我我做错了什么。 谢谢如果我没弄错,您已经将依赖项添加到weasis核心ui,并尝试从weasis dicom资源管理器访问它了吗 这通常是可能的,但被认为是不好的做法(因为它要求您导出不受您控制的包)。更好的方法是将weasis核心ui的接

我正在从事一个maven项目,该项目有多个子项目,在子项目weasis核心ui中,我添加了一些JAR,我想在项目中使用这些JAR

我通过在weasis核心ui的pom.xml中添加依赖项实现了这一点:下面的代码包含了我正在使用的依赖项 pom.xml

请告诉我我做错了什么。
谢谢

如果我没弄错,您已经将依赖项添加到weasis核心ui,并尝试从weasis dicom资源管理器访问它了吗

这通常是可能的,但被认为是不好的做法(因为它要求您导出不受您控制的包)。更好的方法是将weasis核心ui的接口定义为尽可能少地依赖第三方数据类。然而,即使配置正确,它似乎也无法工作,因为weasis核心ui也存在布线问题。 当捆绑包在MANIFEST.MF文件中找不到它声明为依赖项的所有包时,就会发生连接异常。在您的例子中,缺少“javax.xml.rpc”

现在发生的事情很乏味。您需要了解为什么weasis核心ui实际上需要javax.xml.rpc。如果您的代码实际上没有使用需要这个包的功能,您可以简单地删除javax.xml.rpc的import-package指令,一切都应该正常。如果您确实使用了需要这一点的代码,那么您将需要找到一个导出该包的包或一个包含包轴的jar包

现在,删除import语句的方式在很大程度上取决于MANIFEST.MF的管理方式。如果您手动管理它,您可以简单地删除该行,如果您通过maven bundle插件管理它,您需要相应地修改pom以排除javax.xml.rpc

<dependency>
            <groupId>javax.xml.rpc</groupId>
            <artifactId>javax.xml.rpc</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/axis.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>Disc</groupId>
            <artifactId>Disc-Id</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/commons-discovery-0.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>JXRPC</groupId>
            <artifactId>JXRPC-Id</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/jaxrpc.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>SAAJ</groupId>
            <artifactId>SAAJ-Id</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/saaj.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>WSDL</groupId>
            <artifactId>WSDL-Id</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/wsdl4j.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>LOGGING</groupId>
            <artifactId>LOGGING-Id</artifactId>
             <version>1.0.0</version>
            <scope>system</scope>
             <systemPath>E:/TestClient/WebContent/WEB-INF/lib/commons-logging.jar</systemPath>
        </dependency>
    27.05.2014 15:00:56.086 *INFO* [FelixStartLevel] org.weasis.core.api.internal.Activator Register Codec Plug-in: Sun java imageio
ERROR: Bundle weasis-core-ui [24] Error starting file:C:\Users\Taha-test\.m2\repository/org/weasis/core/weasis-core-ui/2.0.0-SNAPSHOT/weasis-core-ui-2.0.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-core-ui [24]: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.rpc))
org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-core-ui [24]: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.rpc)
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3984)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2045)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
    at java.lang.Thread.run(Thread.java:662)
27.05.2014 15:00:56.165 *INFO* [FelixStartLevel] org.weasis.core.api.internal.Activator Register Codec Plug-in: dcm4che
org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-dicom-explorer [5]: Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (&(osgi.wiring.package=it.cnr.imaa.essi.lablib.gui.checkboxtree)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.rpc)]
ERROR: Bundle weasis-dicom-explorer [5] Error starting file:C:\Users\Taha-test\.m2\repository/org/weasis/dicom/weasis-dicom-explorer/2.0.0-SNAPSHOT/weasis-dicom-explorer-2.0.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Unresolved constraint in bundle weasis-dicom-explorer [5]: Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (&(osgi.wiring.package=it.cnr.imaa.essi.lablib.gui.checkboxtree)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve 24.0: missing requirement [24.0] osgi.wiring.package; (osgi.wiring.package=javax.xml.rpc)])
    at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3984)
    at org.apache.felix.framework.Felix.startBundle(Felix.java:2045)
    at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
    at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
    at java.lang.Thread.run(Thread.java:662)

Cannot not start framework: java.lang.Exception: Main User Interface bundle cannot be started
Weasis cache will be cleaned at next launch.