Programing

Eclipse + Spring Boot의 "throw new SilentExitException ()"에서 중단 점

lottogame 2020. 12. 5. 09:10
반응형

Eclipse + Spring Boot의 "throw new SilentExitException ()"에서 중단 점


Eclipse IDE (Spring Tool Suite)의 디버그 모드에서 Spring Boot 프로젝트를 실행할 때마다 스레드가 "throw new SilentExitException ();"에서 중지됩니다. 중단 점 없이도 줄.

이 동작을 피하기위한 몇 가지 해결책은 무엇입니까?

org.springframework.boot.devtools.restart.SilentExitExceptionHandler.exitCurrentThread () (53 행) :

public static void exitCurrentThread() {
    throw new SilentExitException();
}

이것은 1.3.0 마일스톤으로 업그레이드 한 후에 시작됩니다.

Spring Tool Suite 버전 : 3.7.0.RELEASE 빌드 ID : 201506290649 플랫폼 : Eclipse Luna SR2 (4.4.2)


이것은 안타깝게도 새 spring-boot-devtools모듈 의 알려진 문제입니다 ( https://github.com/spring-projects/spring-boot/issues/3100 참조 ). 이 트릭을 사용하여 메인 스레드를 종료하여 다시로드 가능한 버전으로 교체 할 수 있습니다. 지금까지 디버그 중단 점이 트리거되는 것을 방지하는 방법을 찾지 못했습니다.

지금은 Java-> 디버그 환경 설정에서 "잡지되지 않은 예외에 대한 실행 일시 중지"확인란을 토글하여 발생하지 않도록 할 수 있습니다.


Eclipse on Debug 모드는 이미 제한된 핫 패칭을 허용하기 때문에 리 로더가 대부분의 경우 비생산적이라는 것을 알게되었고 다음과 같이 비활성화하기로 결정했습니다.

System.setProperty("spring.devtools.restart.enabled", "false");

참조 : https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html#using-boot-devtools-restart-disable

해당 예외가 리 로더에 의해 발생하므로이 문제도 해결됩니다. System.setProperty에서 설정하는 대신 방법 을 사용해야합니다 application.properties.


범위 런타임에서 devtools를 실행하십시오.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-devtools</artifactId>
    <scope>runtime</scope>
</dependency>

참고 URL : https://stackoverflow.com/questions/32770884/breakpoint-at-throw-new-silentexitexception-in-eclipse-spring-boot

반응형