问题描述
过去几天我花了几天时间来寻找解决问题的办法。我试图通过bndrun文件使用bndtools启动器,使用3.x兼容性层启动Eclipse RCP。
我知道涉及放置bndtools的解决方案。运行包列表中的runtime.eclipse.applauncher以获得启动的E4应用程序,并且有方法将E3.x应用程序迁移到E4。目前,我们希望对富客户端平台进行程序化控制,因此迁移到XMI文件,以便布局工作台目前并不理想。
I创建了一个使用bndtools构建的插件项目。据我所知,我已经包括了所有必需的软件包来运行应用程序,并遵循了几个例子(除此之外,我发现大多数OSGI示例都是基于控制台的)。
因为我没有看到RCP加载(我们有一个扩展了IApplication接口的RCP插件,我们的项目结构仍然是基于Activator的)我最初对于为什么这不工作,在运行属性中添加-osgi-console =确实提供了一些额外的信息:
使用 -runfw:org.eclipse.osgi
最后一行如下:
#framework = org.eclipse。 osgi.launch.Equinox@59fa1d9b
#注册启动器与参数同步
#将等待注册的Runnable
此外,我用于测试的插件被标记为 STRTD ,并且正在使用它的软件包也被标记为 STRTD 而大多数其他捆绑包都标记为 ACTIV ,我认为这也是问题的一部分。我试图通过包含一行来启动几个包(以下其他示例),但遇到问题,控制台将出现错误,说明无法加载或找到org.eclipse.core.runtime的主类
Googling(甚至Binging)似乎没有出现解决方案,解释如何设置一个使用bndrun文件运行的Eclipse 3.x应用程序。我失踪了什么最近我尝试了以下属性:
-runproperties:\
osgi.os = win32,\
osgi.clean = true,\
osgi.console =,\
eclipse.product = org.eclipse.sdk.ide,\
osgi.arch = x86_64, \
osgi.ws = win32,\
equinox.use.ds = true,\
eclipse.application = org.eclipse.ui.ide.workbench
我假设如果我正在使用的实际测试包实际上会激活,我也应该能够找到应用程序ID集在 plugin.xml 文件中,并使用它。即使我在bnd文件中指定了一个 Bundle-Activator ,尝试激活该插件也会导致找不到主类错误。该Activator似乎没有被启动,因为我设置打印到控制台,没有打印。我认为,由于该捆绑包处于 STRTD 状态,它没有启动。
任何有关这方面的帮助将不胜感激。 >
编辑:
作为更新,添加 org.apache.felix.gogo.runtime 和 org.apache.felix.gogo .shell 确实导致我的测试插件的激活程序启动。奇怪的是,插件依赖于,但从 移动到 RSLVD 。
其他讨论表明,我们可能必须使用 EclipseStarter 手动启动Eclipse实例?
以下包含使用bndtools和Eclipse的一个例子3.8。它在/cnf/eclipse_common_3.8/bndtools.runtime.eclipse.applaunch-0.1.0.jar中使用了一个适应的bndtools.runtime.eclipse.applauncher,参见3.8 bnd启动配置还包括这里example.aspectj / example.aspectj。 bnd.app/run/launch_org.eclip se.osgi_3.8.x.bndrun。这是(在repo中演示的Aspect东西旁边)最小的捆绑包,用bnd启动Eclipse应用程序成功。
I have spent the past few days trying to find a solution to my problem. I am trying to launch an Eclipse RCP using the 3.x compatibility layer using the bndtools launcher via a bndrun file.
I am aware of the solution which involves placing bndtools.runtime.eclipse.applauncher in the list of run bundles in order to get an E4 application to start and that there are ways to migrate an E3.x application to E4. We would like to maintain programmatic control over the Rich Client Platform for the time being so migrating to an XMI file for laying out the Workbench is not ideal at this time.
I created a plug-in project which builds using bndtools. To my knowledge I have included all of the necessary bundles to run the application and have followed several examples (as an aside, most of the OSGI examples I found were console-based).
Because I wasn't seeing the RCP load up (we have an RCP plug-in which extends the IApplication interface and our project structure is still Activator based) I was initially at a loss as to why this wasn't working but adding -osgi-console= to the run properties did provide some additional information:
Using -runfw: org.eclipse.osgi
The final lines are the following:
# framework=org.eclipse.osgi.launch.Equinox@59fa1d9b
# registered launcher with arguments for syncing
# will wait for a registered Runnable
Additionally, the plug-in I am using to test with is marked as STRTD and the bundle that is using it is also marked as STRTD whereas most other bundles are marked as ACTIV, which I assume is also part of the problem. I have tried to force bundles to start by including a line to start several bundles (following other examples) but have run into issues where the console will error stating could not load or find main class for org.eclipse.core.runtime when trying to include that in the list of activated bundles.
Googling (and even Binging) have not appeared to produce a solution which explains how to set up an Eclipse 3.x application to run using a bndrun file. What am I missing? Most recently I tried the following properties:
-runproperties: \
osgi.os=win32,\
osgi.clean=true,\
osgi.console=,\
eclipse.product=org.eclipse.sdk.ide,\
osgi.arch=x86_64,\
osgi.ws=win32,\
equinox.use.ds=true,\
eclipse.application=org.eclipse.ui.ide.workbench
I assume that if the actual test bundle I am using would actually activate that I should also be able to find the application ID set in the plugin.xml file and to use that instead. Trying to activate that plug-in also results in a could not find main class error even though I specify a Bundle-Activator in the bnd file. That Activator does not appear to be started since I have it set to print to the console and nothing is printed. I assume that since the bundle is in the STRTD state that it did not start.
Any help with this would be appreciated.
Edit:As an update, adding org.apache.felix.gogo.runtime and org.apache.felix.gogo.shell did result in my test plug-in's activator getting started. Curiously the plug-in it is dependent on, though, moved from STRTD to RSLVD.
Other discussion has indicated that we might have to manually start an Eclipse instance using EclipseStarter?
The following Github repo contains using an example with bndtools and Eclipse 3.8. It uses an adapted bndtools.runtime.eclipse.applauncher inside /cnf/eclipse_common_3.8/bndtools.runtime.eclipse.applaunch-0.1.0.jar see the 3.8 bnd launch config also include here example.aspectj/example.aspectj.bnd.app/run/launch_org.eclipse.osgi_3.8.x.bndrun. This was (beside the Aspect stuff demoed in the repo) the smallest set of bundles to startup an Eclipse app successfully with bnd.
这篇关于使用bndtools启动Eclipse 3.x RCP应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!