7 Replies Latest reply on Nov 7, 2007 1:38 PM by Italo Vecchi

    JBoss debugging problem

    Italo Vecchi Newbie

      I want to debug remotely on JBoss, so I uncommented the relevant line in run.bat.

      Here is what I get.

      C:\e-workspace\jboss-4.2.1.GA\bin>run
      ===============================================================================

      JBoss Bootstrap Environment

      JBOSS_HOME: C:\e-workspace\jboss-4.2.1.GA

      JAVA: C:\Sun\SDK-5\jdk\bin\java

      JAVA_OPTS: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787, server=y, suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true

      CLASSPATH: C:\Sun\SDK-5\jdk\lib\tools.jar;C:\e-workspace\jboss-4.2.1.GA\bin\run.jar

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

      ERROR: transport error 202: connect failed: Connection refused ["transport.c",L41]
      ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
      JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initializedFATAL ERROR in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)

      I will be grateful for any feedback.

      t


        • 1. Re: JBoss debugging problem
          jaikiran pai Master

          A google search for this leads to lots of posts which complain about this error with JDK5. Some suggest

          adding 127.0.0.1 localhost in /etc/hosts


          and some others suggest

          The key is to have the JDK 1.5 beta *JRE* bin directory
          listed in your path. (make sure it comes before any
          other JREs).


          I even found some posts which mention that this might be because of the firewall installed on the system (try disabling it, if you have one). See if any of these work for you.



          • 2. Re: JBoss debugging problem
            Italo Vecchi Newbie

            Thanks for your helpful reply.

            The problem shows up also with JDK 1.6. Actually I switched from 1.6 to 1.5 to see it it would make any difference. I tried out your interesting *JRE*suggestion. Same soup:

            C:\e-workspace\jboss-4.2.1.GA\bin>run
            ===============================================================================

            JBoss Bootstrap Environment

            JBOSS_HOME: C:\e-workspace\jboss-4.2.1.GA

            JAVA: C:\Sun\SDK-5\jdk\jre\bin\java

            JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=8787, server=y, suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true

            CLASSPATH: C:\Sun\SDK-5\jdk\lib\tools.jar;C:\e-workspace\jboss-4.2.1.GA\bin\run.jar

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

            ERROR: transport error 202: connect failed: Connection refused ["transport.c",L41]
            ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
            JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initializedFATAL ERROR
            in native method: JDWP No transports initialized, jvmtiError=JVMTI_ERROR_INTERNAL(113)

            I already tried disabling the firewall. That's not it.

            As for "adding 127.0.0.1 localhost in /etc/hosts", I am on Windows Vista, although I might try copying everything over to Ubuntu and check it out there. However I suspect this is one aspect of a problem that I had on Ubuntu too, as well on Win2000 on another machine. Both my machines are relatively slow and I wonder whether the root issue may be a timeout related to that.

            Anyways, if I make any progress I will report it here. Further suggestions are welcome.

            t

            • 3. Re: JBoss debugging problem
              Italo Vecchi Newbie

              OK, this seems to work.

              C:\e-workspace\jboss-4.2.1.GA\bin>run
              ===============================================================================

              JBoss Bootstrap Environment

              JBOSS_HOME: C:\e-workspace\jboss-4.2.1.GA

              JAVA: C:\Sun\SDK-5\jdk\jre\bin\java

              JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true

              CLASSPATH: C:\Sun\SDK-5\jdk\lib\tools.jar;C:\e-workspace\jboss-4.2.1.GA\bin\run.jar

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

              Listening for transport dt_socket at address: 8787
              12:11:40,509 INFO [Server] Starting JBoss (MX MicroKernel)...

              I just moved server=y before the address. Otherwise, since the server default option is "n", it apparently tries to open the socket at the wrong address. See the Xrunjwdp options at http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html.

              Cheers and thanks again.

              t

              • 4. Re: JBoss debugging problem
                jaikiran pai Master

                 

                "tttito" wrote:
                OK, this seems to work.

                C:\e-workspace\jboss-4.2.1.GA\bin>run
                ===============================================================================

                JBoss Bootstrap Environment

                JBOSS_HOME: C:\e-workspace\jboss-4.2.1.GA

                JAVA: C:\Sun\SDK-5\jdk\jre\bin\java

                JAVA_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8787,suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true

                CLASSPATH: C:\Sun\SDK-5\jdk\lib\tools.jar;C:\e-workspace\jboss-4.2.1.GA\bin\run.jar

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

                Listening for transport dt_socket at address: 8787
                12:11:40,509 INFO [Server] Starting JBoss (MX MicroKernel)...

                I just moved server=y before the address. Otherwise, since the server default option is "n", it apparently tries to open the socket at the wrong address. See the Xrunjwdp options at http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html.

                Cheers and thanks again.

                t


                Strange. I wasn't aware that the positioning matters. I still find it hard to believe that this was the reason why it was failing. Are you sure that its not a coincidence that this started working after you changed the order of those parameters.

                Furthermore, the link that you pointed to (http://java.sun.com/j2se/1.5.0/docs/guide/jpda/conninv.html) mentions:

                Sun's VM implementations require command line options to load the JDWP agent for debugging. From 5.0 onwards the -agentlib:jdwp option is used to load and specify options to the JDWP agent. For releases prior to 5.0, the -Xdebug and -Xrunjdwp options are used (the 5.0 implementation also supports the -Xdebug and -Xrunjdwp options but the newer -agentlib:jdwp option is preferable as the JDWP agent in 5.0 uses the JVMTI interface to the VM rather than the older JVMDI interface).


                Have you tried using

                set JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%



                • 5. Re: JBoss debugging problem
                  jaikiran pai Master

                   

                  "jaikiran" wrote:

                  Strange. I wasn't aware that the positioning matters. I still find it hard to believe that this was the reason why it was failing.


                  OK, i now know why you were seeing the exception earlier. It has got nothing to do with the order in which you pass the "server" and "address" parameters.

                  Here's what your parameters were when you were seeing the exception:

                  "tttito" wrote:


                  JAVA_OPTS: -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,address=8787, server=y, suspend=n -Dprogram.name=run.bat -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djmx.invoke.getters=true


                  Observer closely, there's a space after the comma following 8787 (before the server parameter).
                  To reproduce this issue on my local setup (which was working fine for debugging so far), i added a space between the comma separated parameters, and i too started seeing the same exception on startup

                  ERROR: transport error 202: connect failed: Connection refused ["transport.c",L41]
                  ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) ["debugInit.c",L500]
                  JDWP exit error JVMTI_ERROR_INTERNAL(113): No transports initializedFATAL ERROR in native method: JDWP No transports initializ
                  ed, jvmtiError=JVMTI_ERROR_INTERNAL(113)
                  Press any key to continue . . .


                  Once i removed the space between the comma separated parameters, and restarted the server, everything started smoothly.

                  There should not be any space between before or after (any of) those comma separated parameters.

                  So, if you go back to the original order that was present in the run.bat file and remove those spaces, i bet you too will get it working. This is how the JDPA options line should look like in your run.bat file:

                  set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%



                  • 6. Re: JBoss debugging problem
                    jaikiran pai Master

                     

                    "jaikiran" wrote:
                    This is how the JDPA options line should look like in your run.bat file:

                    set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%



                    I meant suspend=n

                    set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n %JAVA_OPTS%





                    • 7. Re: JBoss debugging problem
                      Italo Vecchi Newbie

                      Of course you're right. Now it's all clear.

                      Cheers.

                      t