5 Replies Latest reply on Aug 27, 2010 11:05 AM by Bruno Melloni

    Not able to start remote debugger for Jboss 5.1.0GA and eclipse

    Jamere Morrow Newbie

      I am trying to do remote debugging using eclipse Ganymede and Jboss 5.1.0GA. Can anyone provide me with some help? I have followed a few sites and none have provided the right thing.

       

      I made changes to the run.sh/run.bat but i continuously kept getting the error "Failed to connect to remote VM. Connection refused."

       

      Thanks in advance for the help

        • 1. Re: Not able to start remote debugger for Jboss 5.1.0GA and eclipse
          jaikiran pai Master

          If you are on windows then the change should be done in run.conf.bat and if you are on *nix OS, you have do the change in run.conf. You'll have to uncomment the following section in the correct file:

           

          # Sample JPDA settings for remote socket debuging
          JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"

           

          And then start the server from the command prompt, using run.bat (for windows) or run.sh (for *nix). The in Eclipse, you can point the host to the IP/hostname of the server and port to 8787.

           

          That should get it working. If not, please post more details about what changes you did and what port you specified in Eclipse.

          • 2. Re: Not able to start remote debugger for Jboss 5.1.0GA and eclipse
            Jamere Morrow Newbie

            I have done this. I am on windows so I went to the run.conf.bat and located

             

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

             

            at the bottom which I then removed the rem to set it and ran the run.bat to start the server. From there I went into eclipe and went under the debu configurations which I then set it to use the port stated(8787) and left the localhost as the host. And still receive the same error...

            • 3. Re: Not able to start remote debugger for Jboss 5.1.0GA and eclipse
              jaikiran pai Master

              Please post the logs that you see on the console (not server.log) when you start the server. I'm mainly interested in the first few lines of the console where it logs the echo statements and then some of the initial java logging. Something like:

               

              jpai@jpai-laptop:bin$ ./run.sh -b 0.0.0.0
              =========================================================================
              
                JBoss Bootstrap Environment
              
                JBOSS_HOME: /NotBackedUp/jpai/jboss-5.1.0.GA
              
                JAVA: /opt/Java/SunJava-6/jdk1.6.0_16//bin/java
              
                JAVA_OPTS: -Dprogram.name=run.sh -server -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n -Djava.net.preferIPv4Stack=true
              
                CLASSPATH: /NotBackedUp/jpai/jboss-5.1.0.GA/bin/run.jar:/opt/Java/SunJava-6/jdk1.6.0_16//lib/tools.jar
              
              =========================================================================
              
              Listening for transport dt_socket at address: 8787
              21:11:17,320 INFO  [ServerImpl] Starting JBoss (Microcontainer)...
              21:11:17,321 INFO  [ServerImpl] Release ID: JBoss [The Oracle] 5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221053)
              21:11:17,321 INFO  [ServerImpl] Bootstrap URL: null
              21:11:17,321 INFO  [ServerImpl] Home Dir: /NotBackedUp/jpai/jboss-5.1.0.GA
              21:11:17,321 INFO  [ServerImpl] Home URL: file:/NotBackedUp/jpai/jboss-5.1.0.GA/
              21:11:17,321 INFO  [ServerImpl] Library URL: file:/NotBackedUp/jpai/jboss-5.1.0.GA/lib/
              21:11:17,322 INFO  [ServerImpl] Patch URL: null
              21:11:17,322 INFO  [ServerImpl] Common Base URL: file:/NotBackedUp/jpai/jboss-5.1.0.GA/common/
              21:11:17,322 INFO  [ServerImpl] Common Library URL: file:/NotBackedUp/jpai/jboss-5.1.0.GA/common/lib/
              21:11:17,322 INFO  [ServerImpl] Server Name: default
              21:11:17,323 INFO  [ServerImpl] Server Base Dir: /NotBackedUp/jpai/jboss-5.1.0.GA/server
              
              • 4. Re: Not able to start remote debugger for Jboss 5.1.0GA and eclipse
                Jamere Morrow Newbie

                I finally got it to work but is there a way to get it to work by starting Jboss in eclipse. For me to get this to work I have to start jboss from the run.bat then go into eclipse debug and start my run debug configuration then it connects.

                 

                I was receiving that error when trying to start jboss in eclipse then go run my debug configuration.

                • 5. Re: Not able to start remote debugger for Jboss 5.1.0GA and eclipse
                  Bruno Melloni Newbie

                  If your instance of jBoss is local (in the same machine as Eclipse) the easiest way to integrate the two is by installing the jBoss Tools plugin.

                   

                  Now... I am having the same problem as the original poster, although I am trying to connect to an instance of jBoss that is on a different server.  That server is properly configured (at port 8787) and I configured that by connecting to it using jdb and performing various operations like listing the classes that are loaded at the time:

                   

                  jdb -connect com.sun.jdi.SocketAttach:hostname=<IP>,port=8787

                   

                  But Eclipse (ganimede SR2) keeps giving me a connection timeout, even though I have the correct IP, port, and socket-attach connection method. The PC with Eclipse is running Windows XP and the server is on Windows 2008 server.

                   

                  Any clues as to what might be happening?