8 Replies Latest reply on May 5, 2003 6:40 PM by ravisatchi1

    HELP!  Eclipse/Jboss/EJB debugger not working

    div_

      Well, since no one replied to my previous posting I'll try again with a slightly different slant. I am trying to debug enterprise java beans (on the same server)using the Eclipse IDE/Jboss and so far have had very little success due to the fact that I am unable to connect to the VM when I initiate the debug session! Can anyone recommend or provide a tried and true example of a Eclipse/Jboss project (for newbies) that includes enterprise java beans, that would allow me to use the Eclipse debugger with the Jboss application server. My hope is that I could step through the bean as well as the client. Please include how you may have modified the run.bat to accomplish this? Really any cooperation here would be appreciated :)

        • 1. Re: HELP!  Eclipse/Jboss/EJB debugger not working
          hansd

          If you don't need remote debugging, that is if you start the JBoss server from within Eclipse you are already done. Just set the breakpoints and debugging works.

          If you need remote debugging it depends on your JVM what options you have to set. Have a look at the quick start guide for JBoss-IDE. And have a look at the known problems section in the releasenotes.

          • 2. Re: HELP!  Eclipse/Jboss/EJB debugger not working
            h2o_polo

            Well to remote debug you do not really need jboss-ide

            all you have to do is

            1. modify run.bat so that remote debuging is enabled (just uncomment JAVA_OPTS Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n [and set the last parameter suspend=n, as it is suspend=y in the run.bat/sh])

            2. start jboss.

            3. deploy your package (make sure that when you debug your class files do include debugging info)

            Now you are set to attach to your VM and do some debugging.

            4. from eclipse side set the breakpoints where you want them. Then go to Run > Debug > Remote Java Application click new button and type in all the relevant info. The only thing you need to change is the port (it is set to 8787 from within run.bat) After you are done with the parameter settings click Debug button.

            5. make your server execute the piece of code that you set the breakpoint(s). Jboss halts to wiat for eclipse. Jump to eclipse you will see the reached breakpoint higlighted. You can step over, step in, watch the vars etc.

            That is it.
            Alex.

            • 3. Re: HELP!  Eclipse/Jboss/EJB debugger not working
              hansd

              > Well to remote debug you do not really need
              > jboss-ide

              You're right. But the JBoss-IDE remote debugging enables you to monitor logfiles and to have a better controll over the lifecycle of the debugging process.

              • 4. Re: HELP!  Eclipse/Jboss/EJB debugger not working
                h2o_polo

                >You're right. But the JBoss-IDE remote debugging enables
                >you to monitor logfiles and to have a better controll
                >over the lifecycle of the debugging process.

                What do you mean by the latter? Can you itemize the differences? I tried JBoss-IDE but have not seen anything radically different in terms of debugging. Maybe I missed something?

                As far as log files go I agree it is pretty nifty that you can see them from within eclipse, rather than go and tail -f (I do not even know how to do the same on windows) the logs you want.

                The other cool thing is the XDoclet code assist. More GUIs for that part though will be helpfull.

                1. Some sort of property sheet would be nice. So that you you can be guided thru the XDoclet's numerous options. Suppose you have a property sheet broken down on different tabs (ejb related, jboss related, etc.). As you go thru the outline or the code, the related section of the property sheet is activated and available options are displayed. Some options maybe already filled due to the existing Xdoclet tag in the code, some empty but I will see that they are avaialabe. As it is now, my biggest problem with XDoclet is that there are some optinos I am not even aware of and I am forced to jump between the IDE and XDoclet documents. The code assist is helpfull but it is intermingled with javadoc tags (now I have to know which ones are javadocs also :-))

                2. The other thing that would be very convinient is commenting of the XDoclet code. Sometimes I want to experiment and see what's produced by xdoclet without a section of Xdoclet I go into the xdoc comment and put comment before the dot (ejb. will be ejbcomment.). It would be cool if I could just highlight the xdocclet section and right-click to see a menu option saying comment xdoclet and the section will be magically commented :-)

                Anyway, Hans I think you are doing a great job, man!


                • 5. Re: HELP!  Eclipse/Jboss/EJB debugger not working
                  hansd

                  > What do you mean by the latter? Can you itemize the
                  > differences? I tried JBoss-IDE but have not seen
                  > anything radically different in terms of debugging.
                  > Maybe I missed something?

                  I just mean that the server that is configured is shown in the server navigator and/or can be defined as the default server and be controlled via a button bar. Via those controlls you can controll the lifecycle and display the logs and for non-remote servers the console. That's it.

                  > 1. Some sort of property sheet would be nice. So that
                  > you you can be guided thru the XDoclet's numerous
                  > options. Suppose you have a property sheet broken
                  > down on different tabs (ejb related, jboss related,
                  > etc.). As you go thru the outline or the code, the
                  > related section of the property sheet is activated
                  > and available options are displayed. Some options
                  > maybe already filled due to the existing Xdoclet tag
                  > in the code, some empty but I will see that they are
                  > avaialabe. As it is now, my biggest problem with
                  > XDoclet is that there are some optinos I am not even
                  > aware of and I am forced to jump between the IDE and
                  > XDoclet documents. The code assist is helpfull but it
                  > is intermingled with javadoc tags (now I have to know
                  > which ones are javadocs also :-))

                  At least some progress and the property sheet is in the making.

                  > 2. The other thing that would be very convinient is
                  > commenting of the XDoclet code. Sometimes I want to
                  > experiment and see what's produced by xdoclet without
                  > a section of Xdoclet I go into the xdoc comment and
                  > put comment before the dot (ejb. will be
                  > ejbcomment.). It would be cool if I could just
                  > highlight the xdocclet section and right-click to see
                  > a menu option saying comment xdoclet and the section
                  > will be magically commented :-)

                  That's a cool idea :-)

                  > Anyway, Hans I think you are doing a great job, man!

                  thanks

                  • 6. Re: HELP!  Eclipse/Jboss/EJB debugger not working
                    ravisatchi1

                    I have done all what you have said. Still, I'm getting the same thing:

                    Refused Connection to VM.

                    Is there something that I'm missing?

                    Also, what do you mean by the following:

                    3. deploy your package (make sure that when you debug your class files do include debugging info)


                    Though, I believe that has nothing to do with the problem. Also, I must tell you I'm using the LOMBAZ plug in.

                    Thanks,
                    RAvi

                    • 7. Re: HELP!  Eclipse/Jboss/EJB debugger not working
                      ravisatchi1

                      Hello,

                      I think I found the problem... But I don't know the solution.

                      It seems that Lomboz (I'm running the server from Lomboz) doesn't uses run.bat.

                      So, I don't know where to instruct so that JBoss runs on debug mode.

                      Thanks,
                      Ravi

                      • 8. Re: HELP!  Eclipse/Jboss/EJB debugger not working
                        ravisatchi1

                        Hello,

                        Does it make a difference if I use Lomboz to start the server?

                        I think it is not executing run.bat. Hence, it should. Then, where do I tell so that JBoss run on debug mode.

                        Ravi