facebook

How to debug with Jboss 3.2.1

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #197545 Reply

    erotkop
    Member

    Hi,

    I am running simple web app from MyEclipse using Jboss 3.2.1 with Tomcat 4.1.24. I was able to deploy it to jboss from MyElipse as
    compressed WAR file.
    I have two questions:

    1. Can I debug JSPs? How?

    2. How can I debug java classes? I tried to put a breakpoint inside a java
    class which is called by JSP, but nothing happens. I wasn’t able to find
    any topics/examples in your documentation. Please, help.

    One more question. When I created JSP page with Struts tag libs (using MyEclipse JSP wizard), I got an error in the tasks window: “cannot load class: org.apache.struts.taglib.bean.CookieTei”. Struts.jar is in the project CLASSPATH. I am using latest struts 1.1 stable. Any idea why am I getting this error? The JSP works fine when the app is deployed.

    Your prompt response is appreciated since I have 30 days evaluation time during which I would like to test this product and see if it can help with my development.

    #197548 Reply

    Scott Anderson
    Participant

    1. Can I debug JSPs? How?

    Source level debugging of JSP’s requires that the server support JSR-045. Tomcat 4.1 does not. Until JBoss comes bundled with either Tomcat 5 or Jetty 5 you won’t be able to debug JSP’s at the source level in JBoss. However, you can debug into all Java code called by your JSP’s and if you minimize the use of Java directly in your JSP code this should be sufficient.

    2. How can I debug java classes? I tried to put a breakpoint inside a java class which is called by JSP, but nothing happens. I wasn’t able to find any topics/examples in your documentation. Please, help.

    Setting the breakpoint in the editor should do it. Since it didn’t, I’ll assume either you didn’t use our JBoss connector to launch the server, you used your own Ant script to deploy your application instead of our built-in deployers, or you chose to run the JBoss server in ‘Run’ mode instead of debug mode. One of these is most likely the source of your problems. If you haven’t done so already, I’d highly recommend that you work through the web project tutorial in the MyEclipse User Guide to get a good overview about proper setup, deployment, and debugging techniques.

    One more question. When I created JSP page with Struts tag libs (using MyEclipse JSP wizard), I got an error in the tasks window: “cannot load class: org.apache.struts.taglib.bean.CookieTei”

    This is a configuration issue that has come up many times on the forums. Please search for ‘Struts’ using the forum search capability and you’ll find the information you need.

    –Scott
    MyEclipse Support

    #197553 Reply

    erotkop
    Member

    Scott,

    I did everything according to the docs: launched jboss connector,
    it runs in debug mode and I didn’t use ant, but Myeclipse deploy wizard.
    When I setup breakpoint and hit JSP in the browser, application simply hangs. Breakpoint never gets activated.

    Here’s my sample app:

    I have a java class:

    public class Test {

    public static String getDate() { return getDate2(); }

    public static String getDate2() {
    String today = (new Date()).toString();
    // i set breakpoint on String today =…. line
    return today;
    }
    }

    I have a JSP that calls it like this:

    Today is: <%= Test.getDate() %>

    This works w/o breakpoint. Any ideas?

    Thanks.

    #197555 Reply

    erotkop
    Member

    Scott,

    I changed my example to this structure and debugging worked correctly. Now I am curious why it doesn’t work with static calls. Is it a bug in MyEclipse or Jboss?

    Here’s the new code:

    public class Test {

    public static String getDate() {
    return new Test2().getDate();
    }
    }

    public class Test2 {

    public String getDate() {
    String today = (new java.util.Date()).toString();
    return today;
    }
    }

    #197558 Reply

    Scott Anderson
    Participant

    I’ve just retested with this example on the following configuration:
    Windows 2000
    JDK 1.4.1_02
    MyEclipse 2.5.1
    Eclipse 2.1.1 build id: 200306271545
    JBoss 3.2.1

    Breakpoints on both static methods and non-static methods worked as expected. Since I couldn’t replicate your findings I think the problem you’re seeing might be environmental. Please report what versions of everything you’re testing on and we can see what’s different.

    –Scott
    MyEclipse Support

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: How to debug with Jboss 3.2.1

You must be logged in to post in the forum log in