Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/325.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/6/rest/5.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 实现OSGI REST时出错:`OSGI捆绑包未启动:缺少需求`_Java_Rest_Osgi_Bnd - Fatal编程技术网

Java 实现OSGI REST时出错:`OSGI捆绑包未启动:缺少需求`

Java 实现OSGI REST时出错:`OSGI捆绑包未启动:缺少需求`,java,rest,osgi,bnd,Java,Rest,Osgi,Bnd,我正试图用bndtools编写一个osgirest包 我在cnf项目中添加了我需要的所有罐子。 然后我将它们添加到bundle构建路径中 我得到以下运行时异常 OSGi捆绑包未启动:缺少要求OSGi.wiring.package (&(osgi.willing.package=javax.ws.rs)(版本=2.0.0)((版本 =3.0.0))) 我不理解这个错误,因为我使用了javax.ws.rs-api 2.0.1. 我试图在构建路径中明确指定版本,如下所示 -buildpath: \ j

我正试图用bndtools编写一个osgirest包

我在cnf项目中添加了我需要的所有罐子。 然后我将它们添加到bundle构建路径中

我得到以下运行时异常

OSGi捆绑包未启动:缺少要求OSGi.wiring.package (&(osgi.willing.package=javax.ws.rs)(版本=2.0.0)((版本 =3.0.0)))

我不理解这个错误,因为我使用了
javax.ws.rs-api 2.0.1.

我试图在构建路径中明确指定版本,如下所示

-buildpath: \
javax.ws.rs-api;version2.0.1 \
没有任何运气

我用错罐子了吗

多谢各位

这是我的bnd

-buildpath: \
    osgi.annotation,\
    osgi.core,\
    osgi.cmpn,\
    org.apache.felix.dependencymanager,\
    com.google.guava,\
    lmca.ps.util;version=latest,\
    lmca.ps.infrastructure;version=latest,\
    org.ops4j.pax.logging.pax-logging-api,\
    com.fasterxml.jackson.core.jackson-annotations,\
    com.fasterxml.jackson.core.jackson-core,\
    com.fasterxml.jackson.core.jackson-databind,\
    com.fasterxml.jackson.jaxrs.jackson-jaxrs-base,\
    com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider,\
    com.fasterxml.jackson.module.jackson-module-jaxb-annotations,\
    org.eclipse.jetty.alpn.server,\
    org.eclipse.jetty.annotations,\
    org.eclipse.jetty.cdi.core,\
    org.eclipse.jetty.cdi.servlet,\
    org.eclipse.jetty.cdi.websocket,\
    org.eclipse.jetty.client,\
    org.eclipse.jetty.continuation,\
    org.eclipse.jetty.deploy,\
    org.eclipse.jetty.gcloud.session,\
    org.eclipse.jetty.http,\
    org.eclipse.jetty.infinispan,\
    org.eclipse.jetty.io,\
    org.eclipse.jetty.jaas,\
    org.eclipse.jetty.jmx,\
    org.eclipse.jetty.jndi,\
    org.eclipse.jetty.memcached.session,\
    org.eclipse.jetty.nosql,\
    org.eclipse.jetty.plus,\
    org.eclipse.jetty.proxy,\
    org.eclipse.jetty.quickstart,\
    org.eclipse.jetty.rewrite,\
    org.eclipse.jetty.schemas,\
    org.eclipse.jetty.security,\
    org.eclipse.jetty.security.jaspi,\
    org.eclipse.jetty.server,\
    org.eclipse.jetty.servlet,\
    org.eclipse.jetty.servlets,\
    org.eclipse.jetty.unixsocket,\
    org.eclipse.jetty.util,\
    org.eclipse.jetty.webapp,\
    org.eclipse.jetty.xml,\
    org.glassfish.hk2.api,\
    org.glassfish.hk2.external.aopalliance-repackaged,\
    org.glassfish.hk2.external.javax.inject,\
    org.glassfish.hk2.locator,\
    org.glassfish.hk2.osgi-resource-locator,\
    org.glassfish.hk2.utils,\
    org.glassfish.jersey.bundles.repackaged.jersey-guava,\
    org.glassfish.jersey.containers.jersey-container-servlet,\
    org.glassfish.jersey.containers.jersey-container-servlet-core,\
    org.glassfish.jersey.core.jersey-client,\
    org.glassfish.jersey.core.jersey-common,\
    org.glassfish.jersey.core.jersey-server,\
    org.glassfish.jersey.media.jersey-media-jaxb,\
    javax.servlet-api,\
    javax.annotation-api,\
    javax.jms-api,\
    javax.validation.api,\
    jaxb-api,\
    slf4j.api,\
    org.osgi.service.log,\
    org.ops4j.pax.logging.pax-logging-service,\
    org.ops4j.pax.logging.pax-logging-logback,\
    json,\
    javax.ws.rs-api,\
    persistence-api,\
    javassist
-runfw: org.apache.felix.framework;version='[5.6.1,5.6.1]'
-runee: JavaSE/compact1-1.9
-runrequires: \
    osgi.identity;filter:='(osgi.identity=org.apache.felix.dependencymanager.shell)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.dependencymanager)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.command)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.runtime)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.gogo.shell)',\
    osgi.identity;filter:='(osgi.identity=com.google.guava)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.scr)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.fileinstall)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.configadmin)',\
    osgi.identity;filter:='(osgi.identity=lmca.ps.util)',\
    osgi.identity;filter:='(osgi.identity=lmca.ps.infrastructure)',\
    osgi.identity;filter:='(osgi.identity=org.apache.felix.log)',\
    osgi.identity;filter:='(osgi.identity=org.ops4j.pax.logging.pax-logging-service)',\
    osgi.identity;filter:='(osgi.identity=jaxb-api)'
-runbundles: \
    ch.qos.logback.classic;version='[1.1.7,1.1.8)',\
    ch.qos.logback.core;version='[1.1.7,1.1.8)',\
    com.google.guava;version='[20.0.0,20.0.1)',\
    org.apache.felix.configadmin;version='[1.8.12,1.8.13)',\
    org.apache.felix.dependencymanager;version='[4.3.0,4.3.1)',\
    org.apache.felix.dependencymanager.shell;version='[4.0.4,4.0.5)',\
    org.apache.felix.gogo.command;version='[0.16.0,0.16.1)',\
    org.apache.felix.gogo.runtime;version='[0.16.2,0.16.3)',\
    org.apache.felix.gogo.shell;version='[0.10.0,0.10.1)',\
    org.apache.felix.metatype;version='[1.1.2,1.1.3)',\
    slf4j.api;version='[1.7.21,1.7.22)',\
    org.apache.felix.fileinstall;version='[3.5.4,3.5.5)',\
    org.apache.felix.scr;version='[2.0.6,2.0.7)',\
    lmca.ps.util;version=snapshot,\
    lmca.ps.infrastructure;version=snapshot,\
    org.apache.felix.log;version='[1.0.1,1.0.2)',\
    org.ops4j.pax.logging.pax-logging-api;version='[1.9.1,1.9.2)',\
    org.ops4j.pax.logging.pax-logging-service;version='[1.9.1,1.9.2)'
Bundle-Name: foo.bar
Bundle-Description: Example bundle
-runvm: -Dfelix.fileinstall.dir=/home/bar\n\
    -Dfelix.fileinstall.noInitialDelay=true\n\
    -Dfelix.fileinstall.poll=1000\n\
    -Dorg.ops4j.pax.logging.DefaultServiceLog.level=INFO
Bundle-Activator: foo.bar.Activator
Private-Package: foo.bar
完全错误是

could not resolve the bundles: [foo.bar-0.0.0 org.osgi.framework.BundleException: Unable to resolve foo.bar [19](R 19.0): missing requirement [foo.bar [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) Unresolved requirements: [[foo.bar [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))]
]

Failed to start bundle foo.bar-0.0.0, exception Unable to resolve foo.bar [19](R 19.0): missing requirement [foo.bar [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) Unresolved requirements: [[foo.bar [19](R 19.0)] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0)))]
我不得不改变主意

-runee:JavaSE/compact1-1.9


你能用你在运行时拥有的包和没有解决的包的信息更新你的问题吗(完整的错误消息是什么)?@MilenDyankov我更新了我的问题
-runee: JavaSE-1.8