【Spring Boot】Spring Boot Debug调试?

SpringBoot项目调试实战:IDEA Debug全指南 本文详细介绍了在IntelliJ IDEA中使用Debug模式调试SpringBoot项目的最佳实践。主要内容包括:前期配置准备、断点设置技巧(基本/条件/异常断点等)、调试控制操作(单步执行/恢复等)、变量观察分析方法(Variables/Watches视图)、以及针对HTTP请求、依赖注入、数据库操作等常见场景的调试策略。还提供了解决实际Bug的标准流程和注意事项,强调条件断点、异常断点等高效调试技巧的使用,帮助开发者快速定位问题根源。通过系统掌握这些方法,可以显著提升SpringBoot项目的调试效率 阅读详情

在使用spring-boot:run进行启动的时候,如果设置的断点进不去,要进行以下的设置。

1、添加jvm参数配置

在spring-boot的maven插件加上jvmArguments配置。

<project>
  ...
  <build>
    ...
    <plugins>
      ...
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
        <version>1.5.6.RELEASE</version>
        <configuration>
          <jvmArguments>
            -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005
          </jvmArguments>
        </configuration>
        ...
      </plugin>
      ...
    </plugins>
    ...
  </build>
  ...
</project>

或者在命令行指定:

mvn spring-boot:run -Drun.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"

2、添加remote调试

在开发工具里面新增一个remote配置,如debug

Host: localhost

Port: 5005

要先启动项目,然后再启动debug,要启动两次,略显麻烦。。

spring-boot项目在Eclipse中Debug调试就跳转到exitCurrentThread 项目出了点bug需要断点调试 之前把项目改造成spring-boot项目了 debug启动之后自动就跳转到 <strong>public static void exitCurrentThread() { throw new SilentExitException(); }</strong> 这个方法中。 去网上科普了一下发现解决办法也挺简单的 win... 阅读详情

相关推荐

Spring Boot开启debug模式

使用IDEA开发环境时,采用Spring Boot框架开启debug模式的流程

springboot debug模式启动

我们都知道,在idea或者eclipse等IDE工具中,都有debug模式启动,但是这种启动是针对我们自己开发的代码的一种开发运行模式,而springboot提供的debug启动模式是对springboot框架信息打印的模式,需要在配置文件中配置 debug=true 增加后,我们再次启动springboot项目,会发现在控制台打印信息增加了许多 截图中的positive matches下边打印的是springboot启动过程中,自动配置生效的组件,可以看到有aop自动配置,cache缓存自动配置等信息

weixin_38879931的博客 9357

爬取中国空气质量在线监测分析平台

1.准备,爬取的链接地址 https://www.aqistudy.cn/html/city_detail.html 2.分析 a.当打开链接后,数据已经设置好了,说明里面大部分都是js通过ajax调用的, b.打开f12分析代码 通过捕获到的数据包,发现当前请求为ajax,携带着一个为d的参数且该请求携带的数据是加密过的,并且响应也是加密过的 c.这时候的问题就是...

Mr Right 6374

Spring Boot Debug

Spring Boot Debug,文章使用的版本为 spring-boot-2.3.4.RELEASE

LemonsChen 1278

【搭建实战】全国天气预报看板搭建

不仅如此,码匠还一站式提供了企业内部系统常用的租户管理、细粒度的权限控制、审计日志等功能,让您快速搭建后台应用的同时,也为您的企业信息安全保驾护航。是一款国内研发的开发者友好的低代码平台,您无需了解React/Vue等框架的开发、部署等各种细节,就可以快速打通前后端,连接RESTAPI、MySQL、MongoDB等多种数据源,然后通过一套开箱即用的组件,轻松搭建功能完善的数据看板、数据洞察、Admin管理后台等多种应用。天气预报对我们的各项活动有很大的帮助,可以让我们合理安排自己的出行等活动。...

weixin_39545889的博客 429

深度学习:STGCN学习笔记

目录标题基于图神经网络的图分类问题GCN在行为识别领域的应用主要任务研究思路ST-GCN(SpatialTemporal Graph Convolutional Networks for Skeleton-Based Action Recognition)解读原论文解决问题主要贡献核心思想简介OpenPose 预处理基于人体关键点构造graph构造单帧graph(空间域)构造帧间graph(时间域)ST-GCN模型采样函数权重函数空域图卷积空间-时间模型分区策略可学习的边重要性权重TCNST-GCN模型的实

zhe470719的博客 3万+

SpringBoot超详细创建运行过程,一步步带你Debug

一步步带你debug SpringBoot的创建及启动流程

wjs15050的博客 2596

手把手教你用u-center配置ublox GPS模块:从波特率到报文频率全流程

本文提供了一份详细的u-center软件配置ublox GPS模块的完整指南。从硬件连接到软件设置,逐步讲解了如何探测并设置正确的波特率、选择与启用关键的NMEA和UBX报文,以及配置输出频率。文章特别强调了配置固化的重要性,并分享了使用UBX协议进行高效数据解析等高级技巧,帮助开发者快速上手并优化GPS模块性能。

weixin_28285943的博客 901

spring不进debug却反回了_Spring Boot Debug调试,日后必定有用!

最近发现 Spring Boot 本地不能 Debug 调试了,原来 Spring Boot 升级后,对应插件的命令参数都变了,故本文做一个升级。背景:Spring Boot 项目在使用 Spring Boot Maven 插件执行启动命令 spring-boot:run 的时候,如果设置的断点进不去,要进行以下的设置。官方解决方案:By default, the run goal runs yo...

weixin_39529903的博客 138

arduino esp8266_Arduino传感器教程 第22章ESP8266 控制 5V 继电器

ESP8266控制5V继电器目录一、NodeMCU二、工作原理本文将使用亚马逊 AlexaEcho 和 ESP8266 控制 5V 继电器。NodeMCUNodeMCU 是一个开源的 IoT 物联网硬件开发板,由于它支持 WIFI 功能且使用方法十分类似 Arduino 开发板,所以近些年获得了越来越多来自全世界的创客朋友们的青睐。NodeMCU 尺寸与 Arduino Nano 类似。...

weixin_39611722的博客 3458

工业自动化实战:用LabVIEW的DSC模块实现MODBUS-TCP设备控制

本文详细介绍了如何利用LabVIEW的DSC模块实现工业自动化中的MODBUS-TCP设备控制。通过环境准备、核心功能解析、状态机实现及典型工业场景实战,帮助工程师快速掌握稳定可靠的通讯技术,提升工业自动化系统的运行效率。

salt9的博客 1058

java调试案例_Spring-boot的debug调试代码实例

这篇文章主要介绍了Spring-boot的debug调试代码实例,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下xml文件中配置:scf.server.vm.all-Xms512m -Xmx512m -Xmn128m -Xss1024K -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -XX:Par...

weixin_42565755的博客 357

深度学习-算法工程师岗位面试常见问题及解答

一、相关的问题 深度学习优化学习方法(一阶、二阶) 一阶方法:随机梯度下降(SGD)、动量(Momentum)、牛顿动量法(Nesterov动量)、AdaGrad(自适应梯度)、RMSProp(均方差传播)、Adam、Nadam。 二阶方法:牛顿法、拟牛顿法、共轭梯度法(CG)、BFGS、L-BFGS。 自适应优化算法有哪些?(Adagrad(累积梯度平方)、RMSProp(累积梯度平方的滑动平均)、Adam(带动量的RMSProp,即同时使用梯度的一、二阶矩))。 梯度下降陷入局部最优有什么解决

nobles007820的博客 2924

debug hacks中文版—深入调试的技术和工具_Spring Boot Debug 调试秘籍,日后必定有用...

最近发现 Spring Boot 本地不能 Debug 调试了,原来 Spring Boot 升级后,对应插件的命令参数都变了,故本文做一个升级。背景:Spring Boot 项目在使用 Spring Boot Maven 插件执行启动命令 spring-boot:run 的时候,如果设置的断点进不去,要进行以下的设置。官方解决方案:By default, the run goal runs yo...

weixin_31531599的博客 391

GameFramework教程✨六、怎样加载一个3D UI

怎样加载一个3D UI

星河造梦坊 1584

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

关于Spring-boot的debug调试

关于Spring-boot的debug调试 由于之前一直在使用spring-boot开发,但一直苦恼于不知道如何利用debug调试代码.在网上查找了很多文章之后。学习之余决定把spring-boot项目分别在eclipse和idea的调试过程简单做一下整理,方便大家以后能根据自己的需求来学习,不足之处还望指正。其调试原理主要还是利用jvm的远程调试。有兴趣研究的可以看文章最后的链接。pom.x

qq_30005875的博客 4万+

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Spring Boot Debug 调试秘籍,日后必定有用!

最近发现 Spring Boot 本地不能 Debug 调试了,原来 Spring Boot 升级后,对应插件的命令参数都变了,故本文做一个升级。背景:Spring Boot 项目在使用...

Java技术栈,分享最主流的Java技术 1508

VC中sqlite的使用

在VC中对sqlite的使用,实现数据库大批数据的快速插入,读取数据库中的数据在ListCtrl中显示

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Spring Boot Debug调试

在使用maven插件执行spring-boot:run进行启动的时候,如果设置的断点进不去,要进行以下的设置。 1、添加jvm参数配置 在spring-boot的maven插件加上jvmArguments配置。 ... ... ... org.springframework.boot spring

Java技术栈,分享最主流的Java技术 2749

spring-boot-maven-plugin:debug调试程序

spring-boot-maven-plugin的 run goal 可启动程序运行项目。但发现直接执行 spring-boot:run时,不能debug打断点点调试。spring-boot-maven-plugin的官方文档给出了原因和解决方式。 原因 run goal 默认将应用运行于 a forked process,通常方式设置的命令行参数不会作用于程序,因此直接使用run goal,是不能调试程序的。 解决方式 若想调试,或想设置其他JVM 参数,应配置 jvmArguments参数。 方式一

lyterrific的博客 2590

java debug图解_Spring Boot Debug调试过程图解

搜索热词这篇文章主要介绍了Spring Boot Debug调试过程图解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下最近发现 Spring Boot 本地不能 Debug 调试了,原来 Spring Boot 升级后,对应插件的命令参数都变了,故本文做一个升级。背景:Spring Boot 项目在使用 Spring Boot Maven 插件执...

weixin_39989443的博客 242

Spring Boot Debug调试,日后必定有用!

最近发现 Spring Boot 本地不能 Debug 调试了,原来 Spring Boot 升级后,对应插件的命令参数都变了,故本文做一个升级。 背景: Spring Boot 项目在使用 Spring Boot Maven 插件执行启动命令 spring-boot:run 的时候,如果设置的断点进不去,要进行以下的设置。 官方解决方案: By default, the run goal runs your application in a forked process. If you need to d

azzk0520的博客 550

Eclipse使用Debug模式调试Spring Boot项目时跳转到exitCurrentThread的问题

Spring Boot项目使用了spring-boot-devtools工具且在Eclipse中Debug调试会自动跳转到这个方法:public static void exitCurrentThread() { throw new SilentEitException(); }解决方法:Eclipse-&gt;【Preferences】-&gt;【Java】-&gt;【Debug】:去掉...

zhangxiaomin1992的专栏 1833
上一篇: 【SpringBoot】Spring Boot实现热部署?
下一篇: Java面试官:Synchronized是怎么实现的?
加班不秃顶
博客等级 码龄7年 1822粉丝 599原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值