在 Karaf 中调试 OSGI 包的最佳方式

Best way to debug OSGI bundles in Karaf

迄今为止,我已经成功构建了 OSGI 包,并通过 Apache CXF 调用了这些包中定义的 Web 服务。接下来,我希望能够在我的包中设置断点,因为它们在 Karaf 环境中执行。

我调查过 EIK,但似乎该项目已经有一段时间没有活动了?并且兼容性页面表明它兼容的最新 Eclipse 版本是 Juno。

我还在 Whosebug 上看到了 EIK 项目似乎最后活跃时的以下引述:

The Karaf team is now also working on a better integration with EIK, but at the current time it's not yet as deeply integrated as it would be needed (see the related issue)

使用 Eclipse 在 Karaf 3.0.3 或 Karaf 4.0.0 M3 中调试 OSGI 包 运行 的最佳方法是什么?

对我来说最好的方法是在启动 Karaf 时使用调试选项。这允许您执行远程调试(我已经从 Eclipse 和 Intelli J 中完成了,没有任何问题)。只需确保您的源与您 运行 的 karaf 实例是最新的。 有关详细信息,请参阅此内容: