Uncommented Bytes

Wednesday, November 30, 2005

Tomcat Remote Debug with Windows Service?

Does anybody know how to start tomcat for remote debugging when using the windows service that comes with tomcat? I can do it in unix and non-service windows, but can't figure out how to work in with the NT service running on XP.

Any ideas? Please help!

18 Comments:

  • Jeff,
    just open the Tomcat Service Configuration Panel, go to the Java tab and insert the -X... JVM options into the Java Options area each on a separate line and before the -D... options.
    This worked fine on my machine.

    By Anonymous rainer.hesse@unilog.de, at 06 December, 2005 05:27  

  • Thanks for the tip! I’ll try it out today, and post my results.

    By Blogger Jeff Sheets, at 06 December, 2005 08:56  

  • I wish I read Rainer comment before I've struggled with this issue. The important point to note is to put -Xdebug and -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n each ON A SEPARATE LINE.

    By Anonymous biad, at 11 January, 2006 19:23  

  • biad, i'll have to try that. Nothing that I have tried has worked so far. This must have worked for you?

    By Blogger Jeff Sheets, at 13 January, 2006 00:40  

  • I am running tomcat 5.5 as a windows service, and have added the jvm options on the java tab. I am able to connect to the tomcat server in debug mode via eclipse, but no breakpoints cause the application to halt. What could I possibly be doing wrong?

    Thanks,
    MH

    By Anonymous MH, at 19 January, 2006 14:40  

  • @jeff sheets

    i got also issues. but i solved them.

    you have to make sure that there is no blank at the end of each parameter line in the java options.

    By Anonymous Anonymous, at 06 April, 2007 05:27  

  • Geeze, I'm glad I came across this blog. I've been trying to figure that out for some time, switching between java and jvm modes. I was about to give up in frustration and run tomcat as a user process, which has its own problems. Thanks for the help. The single-item per line and no space at the end did the trick.

    By Blogger Michael, at 04 October, 2007 15:16  

  • Hi guys,
    just wanted to thank you - this blog saved my live too :)
    I'm running Tomcat 6.0.14 and it still works the very same way:
    - the -X params come before the -D
    - no spaces at the end of the lines
    - each on a separate line

    I'm using the same settings as biad said in the second comment.

    Thanks :)
    Lydia

    By Anonymous ly, at 17 February, 2008 22:24  

  • Thanx for the solution: Just using different lines. I really was getting mad about this. Eclipse-plugins made it work but I got tiomeouts on trying the independent way. Thanx again.

    By Anonymous Anonymous, at 10 April, 2008 01:30  

  • Great blog, thanks! :)

    By Anonymous Anonymous, at 29 April, 2008 10:23  

  • You guys were spot on. Little things like this should be in the Tomcat docs, but aren't. Thanks for the hand up.

    By Anonymous Anonymous, at 13 August, 2008 17:11  

  • Thanks guys. I am not sure if having the -X before the -D is really necessary as someone suggested. This is otherwise spot on.

    By Anonymous Anonymous, at 03 November, 2008 23:10  

  • many thanks for this!

    By Blogger babim, at 03 March, 2009 06:50  

  • I'm running the windows service - where is the "Tomcat Service Configuration Panel" exactly?

    Thanks

    By Anonymous J, at 17 March, 2010 10:28  

  • 1. Navigate to \bin
    2. Double click on tomcat6W.exe
    3. This will invoke the Tomcat Service Configuration Panel and you will find the Java tab

    By Blogger Vikas, at 21 March, 2010 01:09  

  • Check this link:
    http://wiki.apache.org/tomcat/FAQ/Developing.

    just adding this as this appears as the top link in google.

    By Blogger gauti, at 28 April, 2010 05:40  

  • Thank you for this blog. I have been struggling from last 5 hrs to get it working. It worked for me after i put X params before D params.

    By Anonymous Anonymous, at 18 December, 2010 13:35  

  • it still works great, thanks guys!

    By Blogger Ashish, at 22 March, 2011 15:03  

Post a Comment

Links to this post:

Create a Link

<< Home