5 Replies Latest reply on Jul 16, 2013 7:06 PM by dgolovin

    Eclipse remote connect/debug fails to connect

    toriacht

      Hi,

       

      I have JBoss 7.1.x running in domain mode. I have enabled remote connect like so

       

      rem # Sample JPDA settings for remote socket debugging

      set "PROCESS_CONTROLLER_JAVA_OPTS=%PROCESS_CONTROLLER_JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8788,server=y,suspend=n"

      set "HOST_CONTROLLER_JAVA_OPTS=%HOST_CONTROLLER_JAVA_OPTS% -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

       

      I try to set up remote debug from eclipse but it fails without any meaningful explanation everytime.... 'failed to connect to VM' I have configured Eclipse 'Remote Java Application to connect to localhost:8787

       

      When JBoss starts I can see it is listening...

       

      JAVA_OPTS: -Dprogram.name=domain.bat -Xms64M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djboss.domain.default.config=domain.xml -Djboss.host.default.config=host.xml

       

       

      ===============================================================================

       

       

      Listening for transport dt_socket at address: 8788

      21:20:27,844 INFO  [org.jboss.modules] (main) JBoss Modules version 1.1.2.GA-redhat-1

      21:20:28,828 INFO  [org.jboss.as.process.Host Controller.status] (main) JBAS012017: Starting process 'Host Controller'

      [Host Controller] Listening for transport dt_socket at address: 8787

       

       

       

      How can i see on Jboss side what might be the problem or any other helpful tips! I have tried this on Ubuntu and Windows.

       

      Thanks

      T

        • 1. Re: Eclipse remote connect/debug fails to connect
          wdfink

          I can do that without issues (linux).

          Do you have changed the bind address?

          Also this will only connect the management instance where is no application deployed. Maybe you want to connect the server for application debugging which is different.

          1 of 1 people found this helpful
          • 2. Re: Eclipse remote connect/debug fails to connect
            toriacht

            Hi,

             

            Thank you for replying

             

            1. I haven;t changed the bind address. I am more used to using JBoss in standalone mode and this is the first time i am trying it in domain mode. I have followed the following the following blog for assistance (http://middlewaremagic.com/jboss/?p=1969), I basically added in scenario 1 instructions on top of existing boilerplate config and this is all I have done. I have managed to deploy my app but thats it. The confusing thing for me is if my server is runnig on an offset of 100 and 200 as per the instructions how does that effect dt_socket running on 8787

             

            i can see from the console output that it appears to be bound to 127.0,0.1

             

             

            [Host Controller] 20:20:51,543 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999

            [Host Controller] 20:20:51,956 INFO  [org.jboss.as.host.controller] (Controller Boot Thread) JBAS010922: Starting server ha-server-1

            20:20:52,016 INFO  [org.jboss.as.process.Server:ha-server-1.status] (ProcessController-threads - 3) JBAS012017: Starting process 'Server:ha-server-1'

            [Host Controller] 20:20:52,102 INFO  [org.jboss.as.host.controller] (Controller Boot Thread) JBAS010922: Starting server ha-server-2

            2. Yes you are right, i want to connect so i can debug what is wring with my app! So this is the wrong port for this? Can you pont me in the right direction please? I wish to connect to ha-server-1...

             

            Thanks again,

            T

            • 3. Re: Eclipse remote connect/debug fails to connect
              toriacht

              Hi,

               

              I edited as follows (in hosts.xml) so that i could connect to the individual server...

               

               

               

               

              {code:xml}

              <server name="ha-server-1" group="ha-server-group" auto-start="true">

                          <socket-bindings port-offset="100"/>

                              <jvm name="default">

                            <jvm-options>

                              <option value="-Xrunjdwp:transport=dt_socket,address=18787,server=y,suspend=n"/>

                               </jvm-options>

                         </jvm>

                      </server>

              {code}

               

               

               

               

              VM connection still being refused... i tried 127.0.0.1 and localhost... perplexing!

               

              T

              • 4. Re: Eclipse remote connect/debug fails to connect
                toriacht

                Hi again,

                 

                Thanks for the help. It seems teh issue was Eclipse (on windows and ubuntu!). remote connect  worked forst time when i tried using IntelliJ!

                 

                Thanks

                T

                • 5. Re: Eclipse remote connect/debug fails to connect
                  dgolovin

                  In your example you put jvm-options inside jvm node. If you put it inside server node, it should work. Just verified it in Eclipse Kepler R for Linux with Oracle Java 1.7.0, it works for me with both localhost and 127.0.0.1. Do not forget restart domain server. Also in your example address=18787, but you mention 8787, make sure ports are the same in hosts.xml and eclipse remote debugging launch configuration.

                  1 of 1 people found this helpful