how to set up a remote debug in tomcat server?
please tell me .. how to set up a开发者_JAVA百科 remote debug in Tc Server(Tomcat) ?
I have (Tc Server, Idea 8, Java 1.6)
Thanks..
Start the tomcat instance using the $TOMCAT_HOME/bin/catalina.sh
script as follows:
./catalina.sh jpda start
Using idea look at the options of the server and search for remote, i don't know exactly i do not have it right now to check.
By the way see tomcat's developing faq for a more complete answer.
You can setup remote debug of tomcat by adding
set CATALINA_OPTS=-Xdebug -Xnoagent -DJava.compiler=NONE Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
to your startup.bat file within \bin location.
Then create a debug configuration in your IDE with below connection properties.
Host: localhost Port:8000
Start tomcat and run the debug configuration.
Although tc-server is a variant of tomcat it’s not exactly the same.
In windows based installation you should go to your instance directory and locate the configuration directory, e.g. if my instance is myApp it will be something like C:\dev\runtimes\vfabric-tc-server-developer-2.7.0\myApp\conf
Edit the file wrapper.conf and add the following lines at the end of the
“# Java Additional Parameters” section
wrapper.java.additional.16="-Xdebug"
wrapper.java.additional.17="-Xrunjdwp:transport=dt_socket,address=5000,server=y,suspend=n"
16 and 17 are sequences and they should start with n+1 of your latest existing sequence. In my file it was:
wrapper.java.additional.15="-Xss256K"
So my tc-server will listen for debugers on port 5000 and will not suspend.
This option will not be valid in Linux environment as it does not have a wrapper
精彩评论