5 Replies Latest reply on Dec 3, 2006 11:45 PM by jiangshachina

    How to debug remote JBoss, which is in Linux?

    jiangshachina

      Hi guys,
      I'm using JBoss4.0.4GA and RedHat AS4.0 Linux.
      I want to dubug the remote JBoss in Linux from my Windows machine via Eclipse3.2.

      I modified run.sh and added the following statement
      JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
      under the statement
      JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME"

      I launched the server by command "sh run.sh", then JBoss reported
      run.sh: line 142: -XDebug: command not found
      What's wrong with the matter?
      How can I resolve it?
      Thanks in advance!

      a cup of Java, cheers!
      Sha Jiang

        • 1. Re: How to debug remote JBoss, which is in Linux?
          weston.price

          I would recommend not modifying the run.sh script directly. In your JBOSS/bin directory you will find a file named run.conf. This file contains the necessary parameters to start JBoss in debug mode. You simply need to
          find the line

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


          and uncomment the configuration. If you need to turn it off again, just comment the selection. Also, note the port. If you have something else running on your Linux machine on this port you will have to change this value. Also, you may want to do the following:

          chmod u+x run.sh

          this will allow you to simply execute ./run.sh to start your server.



          • 2. Re: How to debug remote JBoss, which is in Linux?
            jiangshachina

            Hello weston,
            Thanks for your help.

            With your instruction, I removed the my modification in run.sh,
            and uncommented the configuration you mentioned in run.conf.

            Then run "./run.sh", the process just be "listening for transport dt_socket at address: 8787",
            but didn't launch the server and other applications!

            a cup of Java, cheers!
            Sha Jiang

            • 3. Re: How to debug remote JBoss, which is in Linux?
              weston.price

              By default, the debug configuration in run.conf suspends the start of the server and waits for you to attach with your debugger. You can disable this by setting the following property in the run.conf configuration

              suspend=n
              


              Note, your server would start if you attached to the server via Eclipse or JDB on the servername:port you specified.


              • 4. Re: How to debug remote JBoss, which is in Linux?
                weston.price

                Note, just for clarification the property should be set here

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


                • 5. Re: How to debug remote JBoss, which is in Linux?
                  jiangshachina

                  OK, all is fine.
                  Thanks!

                  a cup of Java, cheers!
                  Sha Jiang