在Eclipse中调试Karaf bundle:persist dev:查看URL / ID? [英] Debug Karaf bundles in Eclipse: persist dev:watch URLs/IDs?

查看:305
本文介绍了在Eclipse中调试Karaf bundle:persist dev:查看URL / ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够轻松地从Eclipse中调试在Apache Karaf中运行的OSGi软件包。到目前为止,我确定的最简单的方法是创建启动Karaf的Java应用程序启动器。如果捆绑包以前安装过,那么我可以设置断点,即使是在激活器中,一切都很好。

I want to be able to easily debug an OSGi bundle running in Apache Karaf from Eclipse. The easiest way I've identified so far is to create a Java Application launcher that starts Karaf. If the bundle was previously installed then I can set breakpoints, even in the activator, and all is good.

问题是当代码更改时, mvn install被调用,然后Eclipse Karaf启动器被调用,我正在运行旧的缓存版本的bundle。我从命令行运行Karaf,用Maven URL安装我的软件包,并使用dev:手表成功。但是我发现dev:watch URL并没有持久化。因此,当从Eclipse启动Karaf时,没有看到的URL(Karaf关闭时丢失了以前的URL),并且没有安装新版本的bundle。

The issue is that when a change is made to the code, mvn install invoked, and then the Eclipse Karaf launcher invoked, I am running the old cached version of the bundle. I have played with running Karaf from the command line, installing my bundle with a Maven URL, and using dev:watch with success. But I have found that the dev:watch URLs are not persisted. Thus, when starting Karaf from Eclipse, there are no watched URLs (the previous ones were lost when Karaf was shutdown) and new versions of the bundle are not installed.

是有一种方法可以让dev:看网址是持久的?我寻找可能拥有URL或甚至Karaf命令行选项的属性,可以用于指定没有运气的URL。我甚至试图添加dev:watch命令到etc / shell.init.script,但我得到这个消息在Karaf启动错误在初始化脚本:命令未找到:dev:watch我认为这意味着该命令也运行早在Karaf启动顺序(开发功能尚未启动?)。

Is there a way to get the dev:watch URLs to be persistent? I looked for either properties that might hold the URLs or even Karaf command line options that could be used to specify the URLs with no luck. I even tried to add the dev:watch command to etc/shell.init.script but I get this message at Karaf startup "Error in initialization script: Command not found: dev:watch." I assume this means the command was run too early in the Karaf startup sequence (dev feature not yet started?).

任何帮助将不胜感激,甚至替代方法我没有考虑容易地调试捆绑在来自Eclipse的Karaf目标是避免使用诸如osgi之类的手动命令:每次代码更改时都要安装。

Any help would be appreciated, even alternate ways I haven’t considered to easily debug bundles running in Karaf from Eclipse. The goal is to avoid needing to use manual commands such as osgi:install every time the code changes.

推荐答案

卡拉夫队是现在也正在与EIK进行更好的整合,但目前还没有像需要的那样深入整合。
因此,您提供的方式基本上是进行调试的最佳方式。
使用maven构建您的应用程序,做一个dev:在你的karaf启动并运行时观察。
由于dev:watch是一个Development-Time命令,它不是永久性的。但您仍然可以选择历史,当然您也可以向命令提供多个捆绑ID。

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. Therefore your provided way is basically the best way in doing debugging. Build your application with maven, do a dev:watch when your karaf is up and running. Since dev:watch is a "Development-Time" command it's not intended to be persistent. But you still have the history to choose from and of course you're able to provide multiple bundle IDs to the command.

这篇关于在Eclipse中调试Karaf bundle:persist dev:查看URL / ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆