无法解析标准java导入

时间:2014-06-21 07:58:09

标签: java eclipse osgi

我是一名Java新手,对于Eclipse / OSGi等很新。

我正在尝试运行OSGi包。我在OSGi中安装了所有依赖的jar。 但是在OSGi控制台中启动捆绑包时,我收到以下错误:

org.osgi.framework.BundleException: The bundle could not be resolved.  
Reason:Missing Constraint:Require-Bundle:org.eclipse.xtext;bundle-version="0.0.0"  

标准导入未解决。我该如何解决这个问题呢? 如果我发布更多信息,请告诉我。

osgi> diag 24
file:///C:\Users\<user>\Desktop\RuleEngineDependency  
\org.eclipse.core.runtime_3.8.0.v20120912-155025.jar [24]
**Missing required bundle org.eclipse.osgi_[3.7.0,4.0.0).**
Missing required bundle org.eclipse.equinox.common_[3.6.100,4.0.0).
Missing required bundle org.eclipse.core.jobs_[3.2.0,4.0.0).
Missing required bundle org.eclipse.equinox.registry_[3.4.0,4.0.0).
Missing required bundle org.eclipse.equinox.preferences_[3.4.0,4.0.0).
Missing required bundle org.eclipse.core.contenttype_[3.3.0,4.0.0).
Missing optionally required bundle org.eclipse.core.runtime.compatibility.auth_[3.2.0,4.0.0).
Missing required bundle org.eclipse.equinox.app_1.0.0.
Missing imported package org.eclipse.core.internal.runtime.auth_0.0.0.

osgi> install file:///C:\Users\<user>\Desktop\RuleEngineDependency   \org.eclipse.osgi_3.8.2.v20130124-134944.jar
Bundle id is 25

osgi> diag 25
file:///C:\Users\<user>\Desktop\RuleEngineDependency\org.eclipse.osgi_3.8.2.v20130124-134944.jar [25]
No unresolved constraints.

osgi> diag 24
file:///C:\Users\<user>\Desktop\RuleEngineDependency\org.eclipse.core.runtime_3.8.0.v20120912-155025.jar [24]
**Missing required bundle org.eclipse.osgi_[3.7.0,4.0.0).**
Missing required bundle org.eclipse.equinox.common_[3.6.100,4.0.0).
Missing required bundle org.eclipse.core.jobs_[3.2.0,4.0.0).
Missing required bundle org.eclipse.equinox.registry_[3.4.0,4.0.0).
Missing required bundle org.eclipse.equinox.preferences_[3.4.0,4.0.0).
Missing required bundle org.eclipse.core.contenttype_[3.3.0,4.0.0).
Missing optionally required bundle org.eclipse.core.runtime.compatibility.auth_[3.2.0,4.0.0).
Missing required bundle org.eclipse.equinox.app_1.0.0.
Missing imported package org.eclipse.core.internal.runtime.auth_0.0.0.  

即使在添加了org.eclipse.osgi包之后,它也会被列为缺少依赖项。

1 个答案:

答案 0 :(得分:1)

您的捆绑包没有误导标准的java导入。 bundle清单包含Require-Bundle指令,因此只有在部署org.eclipse.xtext包后,bundle才会重新启动。由于此指令未自动添加,您必须手动添加它或者从另一个Manifest复制。

你的包真的需要xtext吗?如果是,那么您必须将extext bundle部署到OSGi环境中。如果没有,那么删除Require-Bundle标头,它应该可以工作。