spring.threads.virtual.enabled=true spring docs에서는 애플리케이션에 이 옵션을 켜기 전에 공식 Java 가상 스레드 설명서를 읽어보시기 바랍니다 라고 쓰여져있다. WarningOne side effect of virtual threads is that they are daemon threads. A JVM will exit if all of its threads are daemon threads. This behavior can be a problem when you rely on @Scheduled beans, for example, to keep your application alive. If you use virtual threads, the scheduler ..
Spring Framework에서 AOP(Aspect-Oriented Programming)는 강력한 트랜잭션 관리 기능을 제공합니다. 이 기능은 다양한 애플리케이션에서 트랜잭션을 효율적으로 관리할 수 있게 해주지만, 때때로 예상치 못한 문제가 발생하기도 합니다. 이 글에서는 Spring Data JPA를 사용하면서 자주 마주치는 self-invocation 문제와 그 배경에 대해 설명하고, Spring의 AOP가 어떻게 트랜잭션 관리에 적용되는지 구체적으로 살펴보겠습니다. AOP와 트랜잭션 관리란? Spring Framework에서 AOP(Aspect-Oriented Programming)는 다양한 곳에서 사용되는 로직을 한 곳에 모아 관리할 수 있게 해주는 프로그래밍 기법입니다. 예를 들어, 보안, ..
에러스택 Resolved [org.springframework.http.converter.HttpMessageNotWritableException: No converter for [class com.example.demo.controller.ResourceController$$Lambda$821/0x000000011a429db0] with preset Content-Type 'application/octet-stream'] 환경 spring boot 2.4.x 외부 파일을 다운로드 하는 Controller에서 에러 발생 문제가 된 코드 @RestController public class ResourceController { @GetMapping("/resource") public ResponseEntit..
일반적으로 enum 클래스는 마셜링할 때 enum 상수 이름 그대로 변경된다. 마셔링 과정에서 enum 상수를 변경할 때 toString() 메서드를 사용하고, 이 메서드가 enum 상수 이름을 리턴하기 때문이다. 이런 방식은 REST-API 응답을 유연하게 설계할 수 없고, REST-API 설계에 따라 코드에도 영향을 주므로 유연한 프로그래밍을 할 수 없다. 그래서 응답 값과 enum 상수 값은 따로 분리하면 좋다. ex) 애플리케이션 에서는 SINGLE 이라는 enum 상수값이지만 클라이언트에게 응답할 때는 "single"이라는 문자열 값을 리턴. public enum HotelRoomType { SINGLE("single"), DOUBLE("double"), TRIPLE("triple"), QUAD..
jaxb 사용해서 xml을 http body로 떨구어줄 때 해당 태그를 없애는 방법 Jaxb2RootElementHttpMessageConverter의 하위 클래스를 직접 생성하고 마샬러를 사용자 정의한다. @Configuration class XmlConfiguration { @Bean Jaxb2RootElementHttpMessageConverter jaxb2RootElementHttpMessageConverter() { return new Jaxb2RootElementHttpMessageConverter() { @Override @SneakyThrows protected void customizeMarshaller(Marshaller marshaller) { marshaller.setProperty..
환경 spring boot 2.7.10 스프링 배치에서 특정 Job만 실행하고 싶을 때 여러 블로그에서 봤을 때는 properties 파일이나 yaml 파일에 아래와 같은 속성을 넣고 spring.batch.job.names=${job.name:NONE} 실행 시 Program Argument에 아래와 같이 실행 --job.name=특정잡이름 이렇게 하라고 하는데 잘 안된다.. 버전이 바뀌고 나서 안되는 건지는 잘 모르겠는데 구글링 하다가 찾은 방법으로 된다. 해결 Program Argument에 아래와 같이 작성 --spring.batch.job.names=특정 잡이름 추가로 여기서 job의 이름은 job1234 이다. 나는 잡의 이름이 Bean이 생성될 때의 이름인줄 알고 계속 job1을 argume..
검색해도 안 나오길래 직접 작성.. 어떤 SI의 전사가 또한 이 오류를 맞이할 것 같아서.. 엄청난 해결책은 아니지만 그래도 공유차원에서 적는다. 개발환경 spring boot 2.7.10 spring boot starter batch tibero6-jdbc.jar 티베로 버전은 6버전 build.gradle dependencies { implementation 'org.springframework.boot:spring-boot-starter-batch' implementation 'org.mybatis.spring.boot:mybatis-spring-boot-starter:2.2.2' implementation fileTree(dir: 'src/main/resources/libs', includes: ..
티베로를 사용하면 스프링 배치를 사용하려해도 영 시원치 않다. 스프링 배치가 지원하는 표준 데이터 베이스가 아니기 때문에 아래 오류가 나타나느데.. 비표준 데이터베이스를 등록하는 방법이다... @EnableBatchProcessing public class TiberoBatchConfigurer extends DefaultBatchConfigurer { @Autowired private DataSource dataSource; @Autowired private PlatformTransactionManager transactionManager; public TiberoBatchConfigurer() { super(); } public TiberoBatchConfigurer(DataSource dataSou..
- Total
- Today
- Yesterday
- 북리뷰
- mybatis config
- intellij
- oracle
- config-location
- input
- localtime
- Java
- Spring Security
- LocalDate
- Bash tab
- Github Status
- Spring
- springboot
- 오라클
- LocalDateTime
- maven
- JavaScript
- svn
- jQuery
- 베리 심플
- elasticsearch
- Kotlin
- Linux
- docker
- 프로페셔널 스튜던트
- mybatis
- rocky
- window
- Mac
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |