简体   繁体   English

调试tomcat应用程序时如何在windows中启动tomcat调试端口

[英]how to start tomcat debug port in windows while debugging tomcat application

I'm getting Exception while debugging调试时出现异常

Failed to connect to remote VM. Connection refused.
Connection refused: connect.

i have tried command in windows system我在 Windows 系统中尝试过命令

netstat -n -a -p tcp netstat -n -a -p tcp

but my port 8787 was not there how to start that port.但是我的端口 8787 不存在如何启动该端口。

Basic config is: In catalina.bat under tomcat/bin file modify the below.基本配置是: 在catalina.bat下的tomcat/bin文件中修改如下。

  1. CATALINA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
  2. JPDA_OPTS="-agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n"
  3. Run Tomcat from command prompt: catalina.sh jpda start从命令提示符运行 Tomcat: catalina.sh jpda start

Then in eclipse create a debug configuration:然后在 eclipse 中创建一个调试配置:

  • Write any name for the configuration.为配置写入任意名称。
  • Write the project name.写下项目名称。
  • Write the connection type as Standard(Socket Attach)将连接类型写为 Standard(Socket Attach)
  • Host should be localhost主机应该是本地主机
  • Port as 8000( or any port number, but that should be the same in other places also).端口为 8000(或任何端口号,但在其他地方也应该相同)。

see: Remote debugging Tomcat with Eclipse请参阅: 使用 Eclipse 远程调试 Tomcat

When run as windows service, Tomcat's command line options could be stored in registry at HKLM\\Software\\Wow6432Node\\Apache Software Foundation\\Procrun 2.0\\TomcatServiceName path for 64-bit OS and at HKEY_LOCAL_MACHINE\\Software\\Apache Software Foundation\\Procrun 2.0\\tomcat8 for 32-bit.当作为 Windows 服务运行时,Tomcat 的命令行选项可以存储在注册表中的HKLM\\Software\\Wow6432Node\\Apache Software Foundation\\Procrun 2.0\\TomcatServiceName path for 64-bit OS and at HKEY_LOCAL_MACHINE\\Software\\Apache Software Foundation\\Procrun 2.0\\tomcat8对于 32 位。

See Where does Tomcat7w.exe store Settings on Windows .请参阅Tomcat7w.exe 在哪里存储 Windows 上的设置

Those settings can be viewed and changed via running bin\\tomcatw.exe .可以通过运行bin\\tomcatw.exe查看和更改这些设置。

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

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