当前位置:网站首页>Shocked, you can't debug remotely
Shocked, you can't debug remotely
2022-06-09 02:48:00 【Hua Weiyun】
Accidentally learn to see a blog , Just know that there is a remote debug A technique for debugging , Actually , Find the server before bug When , I have always hoped for such a technology , Instead of relying on checking logs every time , Of course, most of the time , It is enough to rely on logs , Reasonable input log , Compared with debug It can locate problems faster and better .
The main steps , Reference is not particularly complicated
1. introduce web rely on It is best to 2.2.6.RELEASE The above
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId></dependency>2. Package to listen jar package
Add plug-ins ,maven Just pack it
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <jvmArguments>-Xdebug -Xrunjdwp:transport=dt_socket,address=5005,server=y,suspend=n</jvmArguments> </configuration></plugin>Their meanings are as follows
-Xdebug notice JVM With debug Way to run
-Xrunjdwp notice JVM Use the run debug environment , It is followed by a series of attribute parameters
transport: Data transmission mode dt_socket socket Mode transfer ,dt_shmem Refers to shared memory
address: The port number of the debugging server , Client connection use
server: Whether to act as a debugging server
suspend: Whether to debug the client
3. Start agent listening jar package
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar xxx.jar Start the just packed jar package
If appear It indicates that the startup is successful

4. Use IDEA,Remote Mode start
Select... In startup mode remote, And enter the corresponding port number

![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-3rzwtdYm-1623688298229)(image-20210613230023399.png)]](https://img-blog.csdnimg.cn/20210615003348587.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Nhb2xpMjAxMzE0,size_16,color_FFFFFF,t_70)
![[ Failed to transfer the external chain picture , The origin station may have anti-theft chain mechanism , It is suggested to save the pictures and upload them directly (img-l0edF9KU-1623688298231)(image-20210613230200362.png)]](https://img-blog.csdnimg.cn/20210615003413242.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L2Nhb2xpMjAxMzE0,size_16,color_FFFFFF,t_70)
Then start the service .
5. Breakpoint debugging
Note that the open project must be consistent with the server
In the code , Make corresponding breakpoints , Then access the server interface . This will be the same as local debugging
Adjust the corresponding parameters , The service will be adjusted accordingly
边栏推荐
- K splitting of dynamic programming /n maximum addend K splitting of n
- Basic usage of flask sqlalmy
- Ccf-csp 201803-4 chess game evaluation +dfs
- Should flying books be ecological? Analyze the first independent SaaS case of all in flybook
- In unity, inherit the lifecycle of monobehavior game objects
- RTSP/Onvif协议视频平台EasyNVR如何配置用户的视频流播放时长?
- Leetcode 1155. N façons de rouler les dés
- Leetcode 801. Minimum number of exchanges DP to increment the sequence
- Basic method of missing data filling (1) -- k-nearest neighbors (KNN) filling
- How does JVM handle exceptions? The principle that finally blocks must execute?
猜你喜欢

How does JVM handle exceptions? The principle that finally blocks must execute?

Jsnpp框架的全链式语法初探

Ccf-csp 201503-3 Festival

FPGA first try

In unity, inherit the lifecycle of monobehavior game objects

Unity中,继承MonoBehaviour游戏对象的生命周期
![[homeassistant Internet access (cpolar)]](/img/37/063986d7d855a1803a7a1a108f7134.png)
[homeassistant Internet access (cpolar)]

Ccf-csp 202104-1 gray histogram 100 points

toggleRowSelection()失效的2个重要影响因素

Sorting out the soft and hard decoding methods of ffmpeg
随机推荐
[homeassistant Internet access (cpolar)]
In 2022, along with the Internet layoffs, the digital economy is stepping up. As a digital hub, the Internet of things platform is moving towards the trend of IOT multi system data fusion and integrat
Ccf-csp 202112-3 boarding pass bar code 100 points
Calendar time operation
C# 类和对象
pkg-config --modversion opencvPackage opencv was not found in the pkg-config search path. Perhaps y
Leetcode 1442. Triple number prefix and + XOR forming two XOR equal arrays
Go技术日报(2022-06-07)——go程序员开发效率神器汇总
Linux 安装Mysql 详细教程(图文教程)
Acwing 791 high precision addition
【HomeAssistant外网访问(cpolar)】
Go技術日報(2022-06-07)——go程序員開發效率神器匯總
Ccf-csp 201403-3 command line options
qt重载的信号槽函数绑定方式
Range of acwing 789 numbers
Period, duration calculation interval
Multi scale aligned distillation for low resolution detection
Backup and restore methods of MySQL database
Mysql database connection query join principle
How to modify ad_ Key connected pin? [chapter]