본문 바로가기

반응형

Study/Java

(190)
STS Newer patch version of Spring Boot available warning disable 처리하기 최근 STS를 사용하면 새 Spring 버전이 release 된 내용을 warning으로 알려준다. 4.17.0에 추가된 기능인 듯하다. https://github.com/spring-projects/sts4/issues/885 바로바로 버전을 변경할 수 있는 환경이면 이런 기능이 좋지만 계속 이전 버전을 사용해야 하고 여러 project를 import 해서 사용하고 있는 환경이면 이 warning이 50개 이상 뜨면서 실제로 보고 싶은 다른 유효한 warning을 보는 걸 방해하게 된다. 이런 경우 새 버전 알림 warning을 disable 처리하면 된다. Preferences -> Spring -> Validation -> Versions and Support Ranges를 선택하고 비활성화를 선택..
Jackson ObjectMapper 특정 요청에 대해서만 jsonIgnore 처리하여 응답하기 objectMapper를 사용하면 보통 다음처럼 @JsonIgnore 처리를 하여 response 값에서 제외 처리를 하게 된다. public class SomeDomain { private int someFieldA; @JsonIgnore private int someFieldB; @JsonIgnore private String someFieldC; } 전체 공통으로 @JsonIgnore를 사용하지 않고 새로 추가하는 요청에 대해 특정 필드를 숨기고 싶은 경우가 있다. simpleModule로 deserializer를 등록하는 건 전체 공통 적용인 것 같고 @JsonView를 @ResponseBody에 사용하려면 기존에 사용하던 전 구간에 @JsonView를 지정해야 하는 문제가 있다. (exclude..
Spring Cloud DataFlow 사용해 보기 Spring Cloud DataFlow 소개 https://dataflow.spring.io/ Spring Cloud DataFlow 는 data-processing use case에 중점을 두고 application 개발과 배포를 간소화한다. 이를 위해 여러 Spring의 여러 라이브러리가 조합되어 기능을 제공한다. 간략하게 소개하면 Spring Cloud DataFlow 는 Spring Integration 과 Spring Batch 로 작성된 Spring Application을 등록하고 Cloud Platform 배포를 관리하는 도구이다. Spring Cloud Dataflow는 두 가지 방식의 data-processing을 처리한다. Streams - CDC (Change Data Capture)..
[troubleshooting] Spring Boot 3.1.0에서 hibernate cannot be cast 오류 발생 Spring Boot 3.1.0으로 적용한 이후 특정 프로젝트가 startup 되지 않는 현상이 발견되었다. 발생한 오류는 다음과 같다. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'someEntityManagerFactory' defined in class path resource [somepackage/config/SomeDataJpaConfig.class]: class org.hibernate.mapping.BasicValue cannot be cast to class org.hibernate.mapping.ToOne (org.hibernate.mapping.BasicValue and o..
STS 4.19.0 Release 소식 및 Windows 11에서 Windows Defender 예외 처리 하기 STS 4.19.0 Release STS가 4.17.0 Release 이후 language server 무한 로딩 현상이 발생하였었다. 2023.01.05 - [Study/Java] - [오류수정반영예정] STS 4.17.x, 4.18.x 무한 로딩 현상 https://luvstudy.tistory.com/217 관련해서 몇 차례 수정이 진행되었었지만 지속적으로 발생하였다. 내 경우 최신 버전의 Spring을 사용한 프로젝트에서는 해당 문제가 발생하지 않았지만 이전 버전 Spring을 사용하는 프로젝트에서 무한 로딩 현상이 계속 발생하였고 이로 인해 어쩔 수 없이 4.17.0 이전 버전 STS를 사용하였다. 2022년 12월 7일 4.17.0이 나온 이후 6개월의 기간 동안 STS 버전 업그레이드를 하지..
Spring JDBC AbstractRoutingDataSource, DelegatingDataSource 사용해 보기 spring-jdbc 소개 spring-jdbc 는 jdbc 관련 기능을 제공하는 라이브러리이다. DB를 연결하여 사용하기 위해 해야 하는 작업 중 상당 부분을 스프링이 처리해 준다. https://docs.spring.io/spring-framework/reference/data-access/jdbc.html Action Spring You Define connection parameters. X Open the connection. X Specify the SQL statement. X Declare parameters and provide parameter values X Prepare and run the statement. X Set up the loop to iterate through the..
Spring Boot 프로젝트 properties 암복호화 처리 구현하기 Spring Boot 프로젝트에서 암복호화 사용에 대해 https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.external-config.encrypting Spring Boot를 사용할 경우 properties의 값의 암호화를 위한 기본 지원을 제공하지 않는다. 다만 Spring Environment에 포함된 값을 수정하는데 필요한 hook point를 제공한다. EnvironmentPostPropcessor interface를 구현하여 application이 start 하기 전에 environment를 조작할 수 있다. 따라서 EnvironmentPostProcessor를 통해 properties의 값..
Spring Boot 3.1 Release Notes 전체 Release Notes 목록은 이곳에서 확인할 수 있습니다. https://luvstudy.tistory.com/tag/Release%20Notes https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.1-Release-Notes 19 revision 기준으로 작성됨 Upgrading from Spring Boot 3.0 Dependency Management for Apache HttpClient 4 Spring Framework 6에서는 Apache HttpClient 5를 선호하기 위해 RestTemplate 을 사용하는 Apache HttpClient 4에 대한 지원이 제거되었습니다. Spring Boot 3.0에는 HttpC..

반응형