5 Replies Latest reply on Oct 30, 2012 12:53 PM by jope

    Remote debugging via SSH?

    jope

      Is there a way to debug a remote JBoss AS 7 from Eclipse / JBoss Tools via SSH?

       

      I'm developing locally in Eclipse and testing on a local JBoss AS 7. I added the local JBoss AS to the JBoss Tools "Servers" view in Eclipse. Even though the line

      {code}#JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"{code}

      is commented in my [JBoss home]/bin/standalone.conf file, I can just hit the "Start the server in debug mode" button in my Servers view in Eclipse, and debugging will just start right away.

       

      Now I have added a remote server that I can access through SSH to the servers list in the Servers view. I can deploy my application to the remote JBoss by dragging it to the server in the Servers view and start it through the "Start the server" button, just like with my local JBoss installation. Only the "start the server in debug mode" button is disabled for the remote server, and I have no clue why. I uncommented the line

      {code}JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"{code}

      in the remote server's [JBoss home]/bin/standalone.conf file, but this didn't help.

       

      localjboss.png remotejboss.png

       

      Is it even possible to debug via SSH? Is there a different secure way for remote debugging that I can try?

        • 1. Re: Remote debugging via SSH?
          maxandersen

          simply use plain normal eclipse java remote applicaiton debugging.

           

          if your remote server is already running with the debug flags that should all be doable.

          1 of 1 people found this helpful
          • 2. Re: Remote debugging via SSH?
            jope

            Well, sort of. If I open port 8787 in the server's firewall and run the standalone.sh script manually, yes, remote debugging over port 8787 works without any further authentication from the debugging client's side. However, when I start the server using the "Start the server" button in my local JBoss Tools, my custom startup options in the remote standalone.conf file get ignored, so the JBoss isn't started in debug mode.

             

            This leaves me with two questions:

             

            1. Which run configuration gets applied when you start a JBoss AS remotely over SSH from local JBoss Tools?

             

            2. Is there a secured way to debug the remote server, like over SSH or HTTPS or at least protected by username and password?

            • 3. Re: Remote debugging via SSH?
              dgolovin

              J. Koch wrote:

               

              1. Which run configuration gets applied when you start a JBoss AS remotely over SSH from local JBoss Tools?

              JBoss Tools server adapter doesn't use any .config file form bin folder, it just generates VM parameters in LocalJBoss71ServerRuntime.getDefaultRunVMArgs(IPath serverHome) and then run server with java using those parameters on local or remote host. Parameters can be changed through editing launch configuration for server.

              J. Koch wrote:

               

              2. Is there a secured way to debug the remote server, like over SSH or HTTPS or at least protected by username and password?

              There is an article Remote Java Debugging via SSH Tunnel Only Works if Local and Remote Ports are Identical. It could help, considering you added missing parameters to command used to start serer on remote host (note, I'm just guessing and haven't tried that myself).

              • 4. Re: Remote debugging via SSH?
                maxandersen

                I've done plenty of remote debugging over ssh with portforwarding on openshift - not sure if I always had local and remote port being the same though; sounds weird if it has to be.

                 

                Just setup ssh portforwards and use remote debugging to connect to localhost:<forwarded port>

                1 of 1 people found this helpful
                • 5. Re: Remote debugging via SSH?
                  jope

                  OK, I have SSH port forwarding set up with local and remote port being identical. It works nicely, so I didn't try out different ports yet. Thank you very much for this advice, this is just what I need.

                   

                  I had a hard time finding the launch configuration that gets applied when the remote server gets started through JBoss Tools, so I'll post a screenshot just in case somebody else with the same issue stumbles upon this thread.

                  remotedebug.jpg

                   

                  Thank you both for the quick and helpful replies! It's too bad I can mark only one answer as correct, since actually the combination of all three answers allowed me to accomplish what I needed.