当前位置:网站首页>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,但又不能立即修复后继续调试,只能修复后部署后继续远程调试
边栏推荐
- C中文件I/O的使用
- 使用mq消息队列来进行下单流程的高并发设计,消息挤压,消息丢失,消息重复的产生场景和解决方案
- 2、 MySQL advanced
- What about PS too laggy? A few steps to help you solve the problem
- 支付流程如何测试?
- Network protocol details: IP
- Counting Nodes in a Binary Search Tree
- 辗转相除法
- Hiding skills of Photoshop clipping tool
- Customize the viewport height, and use scrolling for extra parts
猜你喜欢

再一个技巧,每月稳赚3万+

Knapsack problem DP

辗转相除法

JVM上篇:内存与垃圾回收篇八--运行时数据区-方法区

Transaction database and its four characteristics, principle, isolation level, dirty read, unreal read, non repeatable read?

安装Pygame

Review of various historical versions of Photoshop and system requirements

How to store the startprocessinstancebykey method in acticiti in the variable table

Detailed explanation of mvcc and its principle

Event
随机推荐
Installation and template setting of integrated development environment pychar
探寻通用奥特能平台安全、智能、性能的奥秘!
对话框数据传递
How idea creates a groovy project (explain in detail with pictures and texts)
DBUtils
Could not autowire.No beans of ‘userMapper‘ type found.
安装Pygame
Introduction to dynamic memory functions (malloc free calloc realloc)
When using Photoshop, the prompt "script error -50 general Photoshop error appears“
pyside2____1.安装和案列
What if Photoshop prompts that the temporary storage disk is full? How to solve the problem that PS temporary storage disk is full?
Network protocol details: IP
QT menu bar, toolbar and status bar
深入 Qt5 信号槽新语法
JVM上篇:内存与垃圾回收篇三--运行时数据区-概述及线程
JVM上篇:内存与垃圾回收篇十二--StringTable
Quoted popular explanation
How does the TCP server handle multiple client connections on one port (one-to-one or one to many)
I've heard the most self disciplined sentence: those I can't say are silent
Review of various historical versions of Photoshop and system requirements