To date, I've been successful at building OSGI bundles, and invoking web services defined in these bundles via Apache CXF. Next, I'd like to be able to set breakpoints in my bundles as they are executed within the Karaf environment.
I've looked into EIK, but it doesn't seem that project has been active in a while? And the compatibility page indicates the latest Eclipse version for which it is compatible is Juno.
I've also come across the following quote on StackOverflow from when the EIK project seemed to be last active:
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)
What is the best way to debug OSGI bundles running in Karaf 3.0.3 or Karaf 4.0.0 M3 using Eclipse?
Usually, the easiest way to debug Karaf or any application deployed onto it is to use remote debugging. Remote debugging can be easily activated by using the debug parameter on the command line. Another option is to set the KARAF_DEBUG environment variable to TRUE.
To run your bundles, right click and choose Run as ->OSGi Framework (or debug as). You can tweak which bundles are included in the runtime configuration, and what arguments are used. You may for example want to add -console . You can also create an application for export, which will give you a config.
To add it to the deploy directory run mvn clean package from the root folder of your project (Where the pom. xml resides). This will generate a jar file in the target folder. Drag and drop it to the deploy from there.
The best way for me is to use the debug option when launching Karaf. This allows you to perform remote debugging ( I have done it from Eclipse and Intelli J with no problems). Just make sure your source is up to date with the karaf instance you are running. See this for more info:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With