zoukankan      html  css  js  c++  java
  • Tomcat配置远程调试端口(windows、Linux)

      当我们需要定位生产环境问题,而日志又不清晰的情况下,我们可以借助Tomcat提供的远程调试,设置如下:

    // Linxu系统: apach/bin/startup.sh开始处中增加如下内容: 
    declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8081"
    
    
    // Windows系统: apach/bin/startup.bat开始处中增加如下内容:
    SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8081

      linux打开端口命令的使用方法: nc -lp 8081 &(打开8081端口) 

      linux查看是否打开8081端口: netstat -an | grep 8081

      注:linux下1010端口是默认开的,可以直接设置为调试1010端口即可。


      Eclipse中配置debug>>Debug Configurations>>Java Remote Application:

            

    启动成功之后Disconnect按钮会被点亮。

              

  • 相关阅读:
    iOS AutoLayout的用法
    UIPickerView的使用(一)
    UIPickerView的使用(二)
    logging模块
    configparser模块
    hashlib模块
    json & pickle 模块
    对表的操作
    表记录曾删改查
    库、表曾删改查和存储引擎
  • 原文地址:https://www.cnblogs.com/jing99/p/7538291.html
Copyright © 2011-2022 走看看