当前位置:网站首页>Idea remote breakpoint debugging jar package project
Idea remote breakpoint debugging jar package project
2022-07-03 09:48:00 【Enter the sky with one hand】
List of articles
Preface
springboot The project is being developed , Make it one jar package , Put it into the server runtime , If the report is wrong , How to check is more convenient ?
If the development environment , We can do it in IDEA Set a breakpoint , Easy debugging , But now it's already a jar The package is running on the server .
We can debug remote breakpoints jar Package the project ?
Sure .
One 、 preparation
1. jar Package application
Create your own springboot project , It's very simple , Just write an interface for debugging :
@GetMapping("/test")
public String test(){
int i = 1 / 0;
System.out.println(i);
return "success";
}
become involved jar package , Upload to a virtual machine node , I uploaded it here to 192.168.201.4
1. IDEA To configure
Click on Edit Configurations
choice Remote
Fill in information
Be careful : We just need to modify it Host That one is ok , Instead, we run it remotely jar The node of the package ip
Two 、 Breakpoint debugging
1. function jar package
In the previous step , IDEA Automatically generates a string of things , This is this. :
Copy it !
Go to the virtual machine node , Run the command to start the project :
java Copied instructions -jar Package name
I actually run the command :
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -jar demo.jar
The console can see , It's listening 5005 port
2. Access interface
http://192.168.201.4:8087/test
3. Incoming breakpoint
3、 ... and 、 Be careful
I deliberately let the program throw exceptions here , And print the information , You can see , It's a little different from our local breakpoint ,IDEA The console will not output information , We can only view it on the console of the virtual machine node
IDEA The console of always shows :
But stack information , Running object properties, etc , It can still be done in IDEA What I saw there
also , Running jar Package code and IDEA The code in should be consistent
summary
Welcome to point out my mistake !
边栏推荐
- Convert IP address to int
- Quickly use markdown to edit articles
- [22 graduation season] I'm a graduate yo~
- Oracle数据库 SQL语句执行计划、语句跟踪与优化实例
- The rise and fall of mobile phones in my perspective these 10 years
- STM32 serial communication principle
- Leetcode daily question (2090. K radius subarray averages)
- Project cost management__ Cost management technology__ Article 7 completion performance index (tcpi)
- Install local sources using yum
- Flink learning notes (10) Flink fault tolerance mechanism
猜你喜欢
数字身份验证服务商ADVANCE.AI顺利加入深跨协 推进跨境电商行业可持续性发展
Leetcode daily question (1162. as far from land as possible)
The cyclic shift of PUCCH in NR channel is generated by MATLAB
Leetcode daily question (931. minimum falling path sum)
Electronic product design
Flink CDC practice (including practical steps and screenshots)
Intelligent home design and development
Fundamentals of Electronic Technology (III)__ Logic gate symbols in Chapter 5
UCI and data multiplexing are transmitted on Pusch - placement of data and UCI positions (Part III)
Project cost management__ Topic of comprehensive calculation
随机推荐
文件系统中的目录与切换操作
Flink learning notes (IX) status programming
Flink learning notes (10) Flink fault tolerance mechanism
Leetcode daily question (2212. maximum points in an archery competition)
Hal library sets STM32 clock
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 3 --blinker_ MIOT_ Light (lighting technology app control + Xiaoai classmate control)
Global KYC service provider advance AI in vivo detection products have passed ISO international safety certification, and the product capability has reached a new level
Design and development of biological instruments
Jestson Nano自定义根文件系统创建(支持NVIDIA图形库的最小根文件系统)
【22毕业季】我是毕业生yo~
Nodemcu-esp8266 development (vscode+platformio+arduino framework): Part 1 -- establishment of engineering template -template
The rise and fall of mobile phones in my perspective these 10 years
Shell logic case
Nr-prach:prach format and time-frequency domain
GPIO port details, Hal library operation keys
端午节快乐!—— canvas写的粽子~~~~~
Getting started with shell programming
Fundamentals of Electronic Technology (III)__ Chapter 1 resistance of parallel circuit
STM32 interrupt priority management
uniapp 实现微信小程序全局分享及自定义分享按钮样式