简体   繁体   English

使用tomcat Jdwp端口设置进行Eclipse调试

[英]Eclipse Debugging with tomcat Jdwp port setting

One one project scenario is:- 一个一对一的方案是:

I know how to set the jvm argument for jdwp in ant. 我知道如何在ant中为jdwp设置jvm参数。 I set the following values in ant build file for tomcat jvm arguments 我在ant build文件中为tomcat jvm参数设置了以下值

here "suspend = y" means remote jvm will suspend until debugger is not attached. 这里的“ suspend = y”表示远程jvm将挂起,直到未连接调试器。 This is happening. 这正在发生。 virtual machine suspends and I start eclipse debugger then remote jvm starts 虚拟机挂起,我启动eclipse调试器,然后启动远程jvm

But for my another project I start the tomcat server from eclipse server view. 但是对于我的另一个项目,我从eclipse服务器视图启动了tomcat服务器。 Here I start the eclipse in debug mode using eclipse. 在这里,我使用Eclipse在调试模式下启动Eclipse。 and virtual machine start in debug mode and remote machine suspended. 虚拟机以调试模式启动,远程计算机挂起。

Now My question is where these jvm argument(for remote debugging) mentioned ? 现在我的问题是这些jvm参数(用于远程调试)在哪里提到? when i start server in debugging mode using the eclipse. 当我使用Eclipse以调试模式启动服务器时。 Is eclipse passing the arguments? 蚀是否通过了论点?

what I did for this I checked the catlina.sh and bat file to see the configuration... i see some configuration in catilina.sh file below... 为此,我检查了catlina.sh和bat文件以查看配置...我在下面的catilina.sh文件中看到了一些配置...

if [ "$1" = "jpda" ] ; then
  if [ -z "$JPDA_TRANSPORT" ]; then
    JPDA_TRANSPORT="dt_socket"
  fi
  if [ -z "$JPDA_ADDRESS" ]; then
    JPDA_ADDRESS="6666"
  fi
  if [ -z "$JPDA_SUSPEND" ]; then
    JPDA_SUSPEND="n"
  fi
  if [ -z "$JPDA_OPTS" ]; then
    JPDA_OPTS="-agentlib:jdwp=transport=$JPDA_TRANSPORT,address=$JPDA_ADDRESS,server=y,suspend=$JPDA_SUSPEND"
  fi
  CATALINA_OPTS="$CATALINA_OPTS $JPDA_OPTS"
  shift
fi

if this script is controlling when in this script suspend value is 'n' as above mentioned by suspend=$JPDA_SUSPEND" and JPDA_SUSPEND="n" 如果此脚本正在控制该脚本中的暂停时间,如上面suspend = $ JPDA_SUSPEND“和JPDA_SUSPEND =” n“所述,则暂停值为“ n”

please tell me where these option are available for customization? 请告诉我这些选项可用于自定义?

Thanks 谢谢

You don't have to start eclipse in debug mode, all it needs is starting Tomcat in your server view in debug mode with the bug icon. 您不必在调试模式下启动eclipse,它所需要的只是在服务器视图中以错误图标启动Tomcat的调试模式。 Assuming the same code is deployed as visible in your project, then you can set breakpoints and step through your code. 假设在项目中部署了相同的代码,则可以设置断点并逐步执行代码。

In case you want to do the same with a remote Tomcat, then you have to manually add the debug settings in the start script and connect with a Remote Java Application runtime configuration. 如果要对远程Tomcat执行相同的操作,则必须在启动脚本中手动添加调试设置,并连接远程Java应用程序运行时配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM