facebook

[Closed] Cannot debug internally launch tomcat

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #238938 Reply

    Eric Raymond
    Member

    If I start tomcat externally (from the the shell), I can debug it in Eclipse. But if I start tomcat using the app server connector, it complains about “Failed to Connect to remote VM. Connection refused”.

    Note I have changed the debug target to use port 33065 instead of 8000 and the app server is set to launch in debug mode.

    I am not deploying the webapp (my dev folder is efffectively my webapp so I don’t have to worry about any type of deplyoing and synching during development), so I am starting the debug via a MyEclipse Externally Launched Server Debug Configuration. (I’m guessing when you depoy a webapp, MyEclipse does something “special”.)

    This is very odd.

    #238994 Reply

    Riyad Kalla
    Member

    I think you are making this more complex than it should be, please look at section 7.3 here: http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html

    Once you start Tomcat with the MyEclipse app server connector, that’s it, just start setting breakpoints, don’t launch anything new.

    #238999 Reply

    Eric Raymond
    Member

    Hmmm.

    That does not seem to work. And now that I know what the little “check mark” next to the breaks points mean, I notice that they are not checked when the app server connector is used.

    So what is wrong? Does “deploying the webapp” do something here?

    Assuming we get this working, how do I decide to enter debug or not. With an external app server, I can detach the debugger from it and later reattach to it.

    #239100 Reply

    Riyad Kalla
    Member

    I notice that they are not checked when the app server connector is used.

    What app server and what version? It needs to support JSR 45 and you also have to have the connector set to launch in debug mode.

    Assuming we get this working, how do I decide to enter debug or not.

    If you want to debug, just set break points, if not, unset them or disable them.

    #239200 Reply

    Eric Raymond
    Member

    What app server and what version? It needs to support JSR 45 and you also have to have the connector set to launch in debug mode.

    Tomcat 5.5.9. which should be compliant, right? Yes, the connector is set to launch in debug mode.

    If you want to debug, just set break points, if not, unset them or disable them.

    OK I can work with that, but it feels broken to me. Seems like there should be another method to do this. WHy is this different than running (versus debugging) a stand alone java program. Eclipse (and virtually all other IDE’s) have two ways to start a program (run or debug). Wouldn’t it make more sense to follow the “standard” approach rather invent a new method? I know the app server is a bit different in implementation, but seemsl ike this is less than 10 lines of code to mimic the debug/non-debug semantics…..

    #239202 Reply

    Riyad Kalla
    Member

    Tomcat 5.5.9. which should be compliant, right? Yes, the connector is set to launch in debug mode.

    Yes, if you are using JDK 1.4+ (1.5.0_05 for example) to run Eclipse and Tomcat, this would be an ideal setup for debugging.

    WHy is this different than running (versus debugging) a stand alone java program. Eclipse (and virtually all other IDE’s) have two ways to start a program (run or debug).

    For one, with J2EE development, your runtime platform (server) is not your application. Running your web app is not synonymous with starting up and running an app server, like it is with a client side application. There are stages to the running (Deploy, Start Server, Hit app).

    Many of our developers (and possibly yourself) work on machines or with app servers that can take upwards of a minute to start, so tying the app server running into the application running would most likely be a frowned upon move on our part. Because of this, we pulled the idea of “run configurations” out and implemented a much more basic approach.

    However, with that all said, we may move to a model somewhere between the two for our 5.0 release when we resync with WTP, it is yet to be seen if this is going to be a beneficial move or a move that causes a lot of “WTF is this?!”. What is helping us make this decision is the feedback from users like yourself over the years that let us know what they want and need to get their work done.

    #239234 Reply

    Eric Raymond
    Member

    I’m running jdk 1.5.0_04. I can try the latest point release of java, but is that is going to make a difference.? Note that I can debug with the app server if I launch it from the shell.

    How do we get to a solution here?

    #239249 Reply

    Riyad Kalla
    Member

    but is that is going to make a difference.?

    No

    I think there is some miscommunication going on here, and before we continue I want to make sure we are clear (so I’m not telling you to check plugin versions and it turns out the problem this whole time was that you were using JBossIDE or something).

    1) Do you have Sysdeo’s Tomcat plugin installed?
    2) Do you have JBossIDE installed?

    If you follow section 7 step-by-step from the document I linked above, do you get checkmarks in your debug markers and/or does the debugging work?
    http://myeclipseide.com/enterpriseworkbench/help/index.jsp?topic=/com.genuitec.myeclipse.doc/html/quickstarts/webprojects/index.html

    How are you trying to debug this page? Are you setting a breakpoint in it, then opening a browser and navigating to that page and the breakpoint is just never being hit?

    #239258 Reply

    Eric Raymond
    Member

    1) Do you have Sysdeo’s Tomcat plugin installed?
    2) Do you have JBossIDE installed?

    I have not installed either of these. I have installed the Hibernate plugin.

    Here’s an intersting set of steps and results:

    1) My large probject does not debug. It does not use a myeclipse deploym,ent since I have a symlink from /usr/local/tomcat/webapps/project to my source code tree.

    2) I created a test project using the step by step instructions debugging works.

    3) I changed the name of my ecplise project and the web context-root to project2.

    4) Debugging now works on project2!

    5) Put the name of my ecplise project and the web context-root back to project

    6) Debug still works

    7) Remove the test project

    8) Debug still works!

    So things have fixed themselves! It might have been pilot error, or perhaps there is something very strange about debugging internally if you’ve never deployed any webapp?

    Thanks 🙂

    P.S. New bug: When you add a new deployment, there is an edit box that says “Deploy Location”. This looks editable but is not editable and derived from the app server config and the context root set in MyEclipse-Web properties for the project. IMHO either the edit box should be replaced with something that does not look editable (along with a comment mentioning how you can change this value) or you should let the user edit this (and do something intelligent with the changes).

    #239267 Reply

    Riyad Kalla
    Member

    P.S. New bug: When you add a new deployment, there is an edit box that says “Deploy Location”. This looks editable but is not editable and derived from the app server config and the context root set in MyEclipse-Web properties for the project. IMHO either the edit box should be replaced with something that does not look editable (along with a comment mentioning how you can change this value) or you should let the user edit this (and do something intelligent with the changes).

    If you use a custom deployment, the box is editable and will deploy wherever you specify.

    #239273 Reply

    Eric Raymond
    Member

    That provides another method to do what you want (I edited the project webapp), but still does not fix the UI ‘trap” of the non-editable edit box. Picky, picky.

Viewing 11 posts - 1 through 11 (of 11 total)
Reply To: [Closed] Cannot debug internally launch tomcat

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