How to start Tomcat in debug mode for remote debugging

Well I don't want to start Tomcat from within IDEA cause I have had tried
alot with
the latest builds and had discussions with Eugene Zhuravlev and I have
failed. Check the thread
http://www.intellij.net/forums/thread.jsp?forum=1&thread=10542&tstart=0&tran
ge=15

Anyways, I guess the best way to debug a servlet in Tomcat
through IntelliJ IDEA is by using remote debugging process.

Can someone tell me how I can start Tomcat for remote debuging ?
I know if I want to start my server and connect to my debugger in my IDE
using shared memory, I can use the following parameter
-Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=mydebug
and attach the name "mydebug" to IDEA's debugger

And if I want to connect via socket I can use this parameter
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=12345
and attach the port "12345" to IDEA's debugger

But I don't know where to place the "-Xdebug -Xrunjdwp:transport..."
parameter in Tomcat.

Do I have to edit any file and place this parameter, or do I provide this
parameter from command prompt. Can someone help. Providing an example will
be helpful.

Thanks

Saumendra


3 comments
Comment actions Permalink

You have to set the JPDA_TRANSPORT and JPDA_ADDRESS environment variables. For example (on windows)

set JPDA_TRANSPORT=dt_socket
set JPDA_ADDRESS=9999

Then, start Tomcat.

Make sure you have selected socket transport from IDEA and that you are using the same port as you specified above.

0
Comment actions Permalink

Hi Saumendra,
Just create the following jpda_startup.bat file:

SET JAVA_HOME= SET JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_sock et,server=y,suspend=n,address=5050 call startup.bat -- Best regards, Eugene Zhuravlev JetBrains, Inc, http://www.intellij.com "Develop with pleasure!" "James" ]]> wrote in message
news:ank1n1$ecd$1@is.intellij.net...

Well I don't want to start Tomcat from within IDEA cause I have had tried
alot with
the latest builds and had discussions with Eugene Zhuravlev and I have
failed. Check the thread

>
http://www.intellij.net/forums/thread.jsp?forum=1&thread=10542&tstart=0&tran

ge=15

>

Anyways, I guess the best way to debug a servlet in Tomcat
through IntelliJ IDEA is by using remote debugging process.

>

Can someone tell me how I can start Tomcat for remote debuging ?
I know if I want to start my server and connect to my debugger in my IDE
using shared memory, I can use the following parameter
-Xdebug -Xrunjdwp:transport=dt_shmem,server=y,address=mydebug
and attach the name "mydebug" to IDEA's debugger

>

And if I want to connect via socket I can use this parameter
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=12345
and attach the port "12345" to IDEA's debugger

>

But I don't know where to place the "-Xdebug -Xrunjdwp:transport..."
parameter in Tomcat.

>

Do I have to edit any file and place this parameter, or do I provide this
parameter from command prompt. Can someone help. Providing an example will
be helpful.

>

Thanks

>

Saumendra

>
>


0
Comment actions Permalink

I issue the following:

./catalina.sh jpda start

This will start TC using JPDA with listening on port 8000.

I believe this should work similarly on win32.

0

Please sign in to leave a comment.