spring-boot使用热部署后在Eclipse中Debug调试就跳转到exitCurrentThread

spring-boot热部署可以当修改了class之后自动重启项目,方便调试。在pom.xml中添加

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<optional>true</optional>
		</dependency>

在plugin中添加fork

 

			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
				<configuration>
					<!--fork : 如果没有该项配置,肯定devtools不会起作用,即应用不会restart -->
					<fork>true</fork>
				</configuration>
			</plugin>

配置后后可以自动重启。

 

但debug时发现,第一次启动会莫名进入SilentExitExceptionHandler.exitCurrentThread方法。看日志发现线程名从main变成了restartedMain,应该是此处引起线程退出,自己没有打断点,无法取消。百度一下,Eclipse有配置:window->【Preferences】->【Java】->【Debug】:去掉【Suspend execution on uncaught exceptions】前面的勾。

11:38:46.080 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/E:/workspace/nidap-logservice/target/classes/, file:/C:/workspace/pine-sql/target/classes/]

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.0.1.RELEASE)

2018-08-02 11:38:46.988  INFO 31872 --- [  restartedMain] c.t.n.logservice.LogServiceApplication   : Starting LogServiceApplication on DESKTOP-U8R517O with PID 31872 (E:\workspace\nidap-logservice\target\classes started by admin in E:\workspace\nidap-logservice)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值