Java R3导入不能包含指令

Java R3导入不能包含指令,java,osgi,fuseesb,Java,Osgi,Fuseesb,我有一个JBoss Fuse 6.0.0。我想在其中部署包含在jar中的OSGI包的服务器。部署时,服务器日志包含以下异常: 13:54:01,802 | INFO | l Console Thread | Console | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Exception caught while executing command org.apache

我有一个JBoss Fuse 6.0.0。我想在其中部署包含在jar中的OSGI包的服务器。部署时,服务器日志包含以下异常:

13:54:01,802 | INFO  | l Console Thread | Console                          | 15 - org.apache.karaf.shell.console - 2.3.0.redhat-60024 | Exception caught while executing command
org.apache.karaf.shell.console.MultiException: Error installing bundles:
    Unable to install bundle file:/tmp/my-war-1.0.0-SNAPSHOT.jar
    at org.apache.karaf.shell.console.MultiException.throwIf(MultiException.java:91)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:70)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]
    at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.karaf.shell.console.jline.Console.run(Console.java:176)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
    at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:61)[15:org.apache.karaf.shell.console:2.3.0.redhat-60024]
Caused by: java.lang.Exception: Unable to install bundle file:/tmp/my-war-1.0.0-SNAPSHOT.jar
    at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:45)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]
    ... 11 more
Caused by: org.osgi.framework.BundleException: R3 imports cannot contain directives.
    at org.apache.felix.framework.util.manifestparser.ManifestParser.normalizeImportClauses(ManifestParser.java:351)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.util.manifestparser.ManifestParser.<init>(ManifestParser.java:163)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.BundleRevisionImpl.<init>(BundleRevisionImpl.java:119)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.BundleImpl.createRevision(BundleImpl.java:1199)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.BundleImpl.<init>(BundleImpl.java:96)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.Felix.installBundle(Felix.java:3080)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)[org.apache.felix.framework-4.0.3.redhat-60024.jar:]
    at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:43)[47:org.apache.karaf.shell.osgi:2.3.0.redhat-60024]
    ... 11 more

谷歌对错误信息的搜索结果没有多大帮助。是否有人可以帮助澄清或解决此问题?

您的清单文件缺少以下条目:

Bundle-ManifestVersion: 2
Bundle-SymbolicName: .....
如果没有这些,您的bundle将被认为符合OSGi R3规范,因此
解析:=“可选”
无效。如果您添加这些清单条目,该捆绑包将被视为R4兼容的,应该可以工作

Bundle-ManifestVersion: 2
Bundle-SymbolicName: .....