Java/Spring Boot(71)
-
[YAML_SHOULD_ESCAPE] 경고
경고This key is used in a map and contains special characters. It is recommended to escape it by surrounding it with '[]' [YAML_SHOULD_ESCAPE] application.ymlapplication.yml# 경고가 발생하는 상태spring: kafka: properties: schema.registry.url: ${SCHEMA_REGISTRY_URL:http:/localhost:8081} # 경고를 조치한 경우spring: kafka: properties: '[schema.registry.url]': ${SCHEMA_REGISTRY_URL:http:/localho..
2025.07.15 -
Spring boot의 json 형식에 맞지 않을때, 그 데이터를 로그로 뿌려 주기
@ControllerAdvice 사용request body는 1회만 읽을 수 있기 때문에, ContentCachingRequestWrapper를 이용하여 다음 Filter에 전달GlobalExceptionHandler@Slf4j@ControllerAdvicepublic class GlobalExceptionHandler { @ExceptionHandler(HttpMessageNotReadableException.class) public ResponseEntity handleInvalidJson(HttpServletRequest request, Exception ex) { String body = extractBody(request); log.error("💥 Inval..
2025.04.07 -
JSESSIONID 다른 도메인에 전달
clientcredentials: 'include' const response = await fetch('http://localhost:8080/topics/' + name, { // REST Proxy endpoint method: 'POST', headers: { 'Content-Type': 'application/vnd.kafka.avro.v2+json' }, credentials: 'include', // ✅ This line allows cookies like JSESSIONID to be sent body: JSON.stringify(payload) ..
2025.03.14 -
has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'.
credentials: 'include'를 설정하면, 서버에서는 아래와 같이 설정되어야 함allowCredentials(true) 추가되어야 함 public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("도메인1", "도메인2") // Match your HTML server address .allowedMethods("*") .allowedHeaders("*") .allowCrede..
2025.03.14 -
Cors 에러 처리
@Configurationpublic class CorsConfig { @Bean public WebMvcConfigurer corsConfigurer() { return new WebMvcConfigurer() { @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") .allowedOrigins("http://127.0.0.1:5500") // Match your HTML server address .allowedMethods(..
2025.03.14 -
Spring boot org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot deserialize value of type `java.util.ArrayList<java.util.Map<java.lang.String,java.lang.Object>>` from Object value (token `JsonToken.START_OBJECT`)
Map 형태로 데이터를 보냈는데, List 형태로 데이터를 받아서 에러 발생ClientExt.Ajax.request({ url: '/url', params: { _csrf: document.getElementById('_csrf').innerText, }, method: 'POST', jsonData: { data: data, }, success: function(response) { }, failure: function(response) { Ext.Msg.alert('Error', 'Failed to save changes.'); console.error('Server error:', response.r..
2025.01.28