实施OSGI REST时出错:"OSGi捆绑包未启动:缺少要求" [英] Error implementing a OSGI REST: `OSGi bundle not started : missing requirement`

查看:145
本文介绍了实施OSGI REST时出错:"OSGi捆绑包未启动:缺少要求"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用bndtools编写OSGI REST捆绑软件.

I'm trying to code a OSGI REST bundle with bndtools.

我在cnf项目中添加了我需要的所有jar. 然后我将它们添加到捆绑软件的构建路径中.

I added all the jars that I need in the cnf project. Then I added them to the bundle build path.

我收到以下运行时异常

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

OSGi bundle not started : missing requirement osgi.wiring.package (&(osgi.wiring.package=javax.ws.rs)(version =2.0.0)( (version =3.0.0)))

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

I don't understand the error because I use javax.ws.rs-api 2.0.1.

我试图像这样在buildpath中明确指定版本

I tried to specify the version explicitly in the buildpath like this

-buildpath: \
javax.ws.rs-api;version2.0.1 \

没有任何运气.

我使用了错误的罐子吗?

Do I use the wrong jar?

谢谢

这是我的朋友

-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

-runee: JavaSE-1.8

这篇关于实施OSGI REST时出错:"OSGi捆绑包未启动:缺少要求"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆