Search code examples
javaremote-debuggingapache-karaf

How to allow remote conection with Karaf (for doing remote debugging)?


I need some help.

I have a vmware virtual machine with a Karaf server and some java applications deployed. I've started karaf with debug flag and it opened port 5005 for debugging.

What I want to do is connect to this port with eclipse to do remote debugging, but I am always refused to connect.

I can access to the virtual from an external firefox using the VM IP, but when I enter the karaf port 8181 I'm not able to connect.

Do you know how to enable Karaf to accept remote connections?

Thanks a lot in advance!


Solution

  • I've found the troubles, it was a combination of things.

    First of all, I used Bridged Network in the VM-Ware configuration.

    I started karaf with debug flag. It has enabled port 5005 for debugging. It is:

    bin/karaf debug
    

    My pom.xml was configured with debugger flags. Like:

    <groupId>org.apache.maven.plugins</groupId>
    <configuration>
      ...
      <!-- Necessary in order for the debug levels to be considered-->
      <debug>true</debug>
      <debugLevel>lines,vars,source</debugLevel>
    </configuration>
    

    And the last thing, I had to stop the firewall. In my case was iptables, doing the following:

    service iptables stop
    

    Doing all above steps allows me to perform java remote debugging successfully.

    Thanks all for the comments.