当前位置:网站首页>idea远程调试debug
idea远程调试debug
2022-07-27 05:01:00 【_院长大人_】
idea远程调试debug
配置远程调试参数



在远程主机启动脚本加上生成的参数,启动
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5555
启动命令
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5555 -jar xxx.jar --spring.profiles.active=test

开启远程调试

下图代表可以开始调试,没有的话可能就是没有连上

因为我的断点打在验证码的这一块,只需要调用该方法

如果是远程服务器开启防火墙并未配置规则会导致连接失败
sudo vim /etc/sysconfig/iptables #打开防火墙规则文件
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5005 -j ACCEPT #配置防火墙规则
sudo systemctl restart iptables # 重启生效
关闭调试
- 服务器上多开放个端口是不安全的,调试完毕后可恢复防火墙设置。
- 而 Java 服务器开启 Debug 服务器的功能可以保留,以便之后再次调试。
总结
远程调试的用处也不是那么大,不能作为长期使用的调试工具。只能作为临时调试的手段。
难点有几个:
1、难保证本地代码和远程一致,而且也很难判断是否一致
2、通过远程调试发现了bug,但又不能立即修复后继续调试,只能修复后部署后继续远程调试
边栏推荐
- DBUtils
- Introduction to dynamic memory functions (malloc free calloc realloc)
- 集成开发环境Pycharm的安装及模板设置
- 智慧展厅设计的优势及适用行业分析
- There is no need to install CUDA and cudnn manually. You can install tensorflow GPU through a one-line program. Take tensorflow gpu2.0.0, cuda10.0, cudnn7.6.5 as examples
- Row, table, page, share, exclusive, pessimistic, optimistic, deadlock
- I've heard the most self disciplined sentence: those I can't say are silent
- 文件处理(IO)
- Hiding skills of Photoshop clipping tool
- How to import PS style? Photoshop style import tutorial
猜你喜欢
随机推荐
节流函数的demo——正则表达式匹配
Install pyGame
Use ngrok for intranet penetration
使用mq消息队列来进行下单流程的高并发设计,消息挤压,消息丢失,消息重复的产生场景和解决方案
Advantages of smart exhibition hall design and applicable industry analysis
JVM上篇:内存与垃圾回收篇十--运行时数据区-直接内存
Static and final keyword learning demo exercise
Translation of robot and precise vehicle localization based on multi sensor fusion in diverse city scenes
[Niuke discussion area] Chapter 7: building safe and efficient enterprise services
传智教育|软件测试工程师未来的发展方向有哪些?
Review of various historical versions of Photoshop and system requirements
QT menu bar, toolbar and status bar
feign调用丢失请求头问题解决及原理分析
深入 Qt5 信号槽新语法
MySQL download and installation & perfect uninstall
JVM Part 1: memory and garbage collection part 14 -- garbage collector
写代码涉及到的斜杠/和反斜杠\
测试基础5
When using Photoshop, the prompt "script error -50 general Photoshop error appears“
Invert a Binary Tree









