[ERROR] prepareKotlinBuildScriptModel Task fails in a Java project
문제 원인 :prepareKotlinBuildScriptModel Task fails in a Java project 해결 방안 build.gradle 에 아래와 같은 코드를 넣어준다. tasks.register("prepareKotlinBuildScriptModel"){} IDEA Kotlin 플러그인이 해당 Task 를 실행시키면서 발생하는 것 같은데 원래는 Root 프로젝트에 있을 경우에만 진행되는 것 같다. 멀티모듈 연결이나 다른 작업이 일어나면서 어디선가 꼬이면서 일어나는 것 같다. 참고: https://github.com/gradle/gradle/issues/14889
2022.10.19
[ERROR] Could not write JSON: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?)
오류 내용 Could not write JSON: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) 해결 방안 말 그대로 JSON 으로 변환할 때 Map 객체는 허용하지 않는 의미이다. 아래처럼 Map 인터페이스를 그대로 사용하면서 JSON 으로 직렬화할 때 위와 같은 오류가 생길 수 있다. @Builder @Getter @NoArgsConstructor @AllArgsConstructor public class PostKafkaProxyResponse { private String topic; private int partition; private long offset; private long timestamp; p..
2022.08.02
no image
[ERROR] @WebMvcTest 시 Failed to load ApplicationContext 관련 (feat. JPA)
오류 내용 java.lang.IllegalStateException: Failed to load ApplicationContext ... Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'io.github.service.FooService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchi..
2022.06.07
[ERROR] java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.data.domain.Pageable
오류 내용 java.lang.IllegalStateException: No primary or default constructor found for interface org.springframework.data.domain.Pageable 해결 방안 이 오류는 Spring MVC 에서 Pageable 에 대한 파라미터 리졸버를 찾을 수 없어서 발생한다. 해결 방법은 두 가지인데 WebMvcConfigurationSupport 를 사용하고 있다면, WebMvcConfigurer 로 변경한다. addArgumentResolver 와 같은 Handler 를 오버라이딩을 한 후, PageableHandlerMethodArgumentResolver 를 추가한다.
2022.05.23