简单的 hello world 包 (osgi) 失败
我正在尝试熟悉 OSGI 平台,并且阅读了一本关于它的德语书籍。我尝试按照教程的每个步骤来运行一个简单的“hello world”包,但失败了。
以下是我已完成的步骤:
- 安装 Eclipse (3.7.0)
- 安装 Equinox SDK (3.7) 使用
- 目标平台 OSGi 标准在 Eclipse 中创建一个新插件
- 将一些“hello world”代码放入 BundleActivator 的启动和停止方法中-class
- 在“运行”OSGi 框架配置中配置,仅选择我的包和“org.eclipse.osgi”包。
运行它会给我以下消息。有人可以帮助我让它运行吗?
错误消息可以在这里找到:
osgi> !会议 2011-06-25 09:30:13.625 ----------------------------------------------------------- eclipse.buildId =未知 java.version=1.6.0_24 java.vendor=Sun Microsystems Inc. BootLoader 常量:OS=win32、ARCH=x86、WS=win32、 NL=de_DE 命令行参数:-dev file:C:/Documents 和 设置/itsme/eclipse/workspace/.metadata/.plugins/org.eclipse.pde.core/Hello 世界示例/dev.properties -os win32 -ws win32 -arch x86 -consoleLog -控制台
!ENTRY org.eclipse.equinox.jsp.jasper 4 0 2011-06-25 09:30:17.609 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException:捆绑包 “org.eclipse.equinox.jsp.jasper_1.0.300.v20110502 [37]”不能 解决了。原因:缺少约束:导入包: org.apache.jasper.servlet;版本=“[0.0.0,6.0.0)”位于 org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
I am trying to become familiar with the OSGI platform and I read a German book about it. I tried to follow every tutorial step to get a simple 'hello world' bundle running but it fails.
Here are the steps I've done:
- Installed Eclipse (3.7.0)
- Installed Equinox SDK (3.7)
- Created a new plugin in Eclipse with target platform OSGi standard
- Put some 'hello world' code into the start and stop-methods of the BundleActivator-class
- Configured in 'Run' an OSGi Framework configuration with only my bundle selected and the 'org.eclipse.osgi' bundle.
Running this gives me the following message. Can anybody help me to get it running?
The error messages can be found here:
osgi> !SESSION 2011-06-25 09:30:13.625
----------------------------------------------- eclipse.buildId=unknown java.version=1.6.0_24 java.vendor=Sun
Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32,
NL=de_DE Command-line arguments: -dev file:C:/Documents and
Settings/itsme/eclipse/workspace/.metadata/.plugins/org.eclipse.pde.core/Hello
World Example/dev.properties -os win32 -ws win32 -arch x86 -consoleLog
-console!ENTRY org.eclipse.equinox.jsp.jasper 4 0 2011-06-25 09:30:17.609
!MESSAGE FrameworkEvent ERROR !STACK 0
org.osgi.framework.BundleException: The bundle
"org.eclipse.equinox.jsp.jasper_1.0.300.v20110502 [37]" could not be
resolved. Reason: Missing Constraint: Import-Package:
org.apache.jasper.servlet; version="[0.0.0,6.0.0)" at
org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1327)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定您到底是如何完成您所遵循的教程的每个步骤的,但是 Lars Vogel 的 < a href="http://www.vogella.de/eclipse.html" rel="nofollow">eclipse 教程 非常有用。
我刚刚测试了他的 Hello World OSGi 教程(为 Eclipse 3.7 编写)并且它有效对我来说很好,所以我建议尝试一下。
或者,如果您坚持对现有项目进行故障排除:
听起来您尚未正确激活目标平台。
尝试单击 OSGi 框架运行配置中的“验证捆绑包”按钮(在调试按钮的下拉菜单中,选择“调试配置”)并查看是否通过。如果没有,请尝试取消选中“目标平台”,然后单击“添加所需捆绑包”按钮,然后重试。
我正在运行 Eclipse 3.6,并且可以使用 这个 Equinox 3.7 版本构建作为我的目标平台,没有任何验证错误。
I'm not sure exactly how you accomplished each step of that tutorial which you are following, but Lars Vogel's eclipse tutorials are incredibly useful.
I just tested his Hello World OSGi tutorial (written for Eclipse 3.7) and it worked fine for me, so I recommend trying that.
Alternatively, if you insist on troubleshooting your existing project:
It sounds like you haven't got your target platform activated correctly.
Try clicking the Validate Bundles button in your OSGi framework run configuration (in the debug button's drop down menu, choose Debug Configurations) and see if that passes. If it doesn't, try unticking Target Platform, and click the Add Required Bundles buttons, then try again.
I'm running Eclipse 3.6, and I'm able to launch a new plugin project using this equinox 3.7 release build as my target platform without any validation errors.