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:

Anonymous said...

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.

Jeff Sheets said...

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

Anonymous said...

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.

Jeff Sheets said...

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

Anonymous said...

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

Anonymous said...

@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.

chaoticgoodblogger said...

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.

Anonymous said...

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

Anonymous said...

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.

Anonymous said...

Great blog, thanks! :)

Anonymous said...

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

Anonymous said...

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

Dr Bourbon said...

many thanks for this!

J said...

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

Thanks

Unknown said...

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

Goutham Rao said...

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

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

Anonymous said...

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.

Ashish said...

it still works great, thanks guys!