Maven: org.osgi.framework.BundleException: undefined restriction in package


I am working on a maven project having several subprojects. In the subprojects of the weasis-core-ui project, I added some jars that I want to use in the project.

I did this by adding dependencies to pom.xml weasis-core-ui: The following code contains dependencies, I use pom.xml

<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>

Clean up the projects, then the Maven test, it works fine. But when I run the application, I have this exception.

    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.

Please tell me what I'm doing wrong. Thanks

+4
source share
1 answer

If I understand correctly, have you added dependencies to weasis-core-ui and try to access it from weasis-dicom-explorer?

, , , ( , , ). weasis-core-ui, dataclasses. , , , weasis-core-ui . , , , MANIFEST.MF. "javax.xml.rpc".

, , . , weasis-core-ui javax.xml.rpc. , , , , javax.xml.rpc, . , , , , , - , Axis.

, MANIFEST.MF. , , maven-bundle-plugin, pom, javax.xml.rpc.

0

Source: https://habr.com/ru/post/1542161/


All Articles