2014-06-21 42 views
0

我是一个Java新手,很新的Eclipse/OSGi的等无法解析标准的Java进口

我想运行一个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包之后,它仍会列为缺少的依赖项。

+0

我不确定,但看看这可以有任何帮助:http://www.eclipse.org/forums/index.php/t/317016/ –

回答

1

你的包没有误解标准的java导入。捆绑包清单包含Require-Bundle指令,所以一旦部署了org.eclipse.xtext捆绑包,捆绑包将只会被resovle。由于该指令不是自动添加的,您必须手动添加它或从另一个Manifest复制。

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

+0

如何部署org.eclipse.xtext包? – cppcoder

+0

@ChristianScheider我部署了'org.eclipse.xtext_2.3.0'。但仍然没有解决。它正在寻找'org.eclipse.xtext_0.0.0'。我怎样才能得到'0.0.0'? – cppcoder

+0

0.0.0表示任何。确保你有org.eclipse.xtext_2.3.0所需的所有包,它可以被解析? (你可以通过(主机)osgi控制台进行调查 –