본문 바로가기

에러8

스프링 - url 요청시 이전 url 에서 Error during execution of processor 'org.thymeleaf.spring6.processor.SpringInputGeneralFieldTagProcessor' (template: "layout-main/layout" - line 135, col 19) 가 발생하는 오류 이 url 에서 이 url 로 이동하니 이처럼 해당 html 을 열수 없다고 나온다. 간단한 템플릿 오류로 타임리프 문법 실수를 생각했는데, 그 아래의 에러 내용을 더 보다보니 이해할수 없는 내용이 나왔다. layout-main/layout 파일에서 오류가 발생했다는 말이다. 그리고 layout-main/layout 는 이전 화면, localhost:8080 의 화면이다. 다시 정리하면, 이전 화면에서 오류가 나서 다음 화면으로 못넘어간다는 말이 되는데, 문제는 정작 "/" 로 요청을 날릴때는 어떤 오류도 발생하지 않는다는 것이다. 그렇다고 "/club?clubNo=1" 의 url 이 "/" 으로 가거나, "layout-main/layout" html 파일에 접근하지도 않는다. 더 내려보면 "layout.. 2024. 3. 2.
Spring validation 과정 중, properties에서 지정한 message 가 출력되지 않음. - 타임리프, 스프링 오류 문제 상황. 오류 메시지를 properties 파일을 이용해 직접 작성하려고 한다. 그러나 옳바르게 문구가 나오지 않고 기본 오류 문구만 출력된다. test 환경에서 MessageSource 를 주입받아 확인해보면 errors.properties 파일 내부의 문구가 옳바르게 MessageSource 빈에 등록된건 확인이 가능하다. DTO @Data @AllArgsConstructor public class MemberJoinForm { @NotBlank private String id; @NotBlank private String pw; @NotBlank @Size(min = 2, max = 5) private String name; @Size(min = 4, max = 15) private String.. 2024. 2. 19.
java.lang.IllegalArgumentException: Name for argument of type [java.lang.Integer] not specified, and parameter name information not available via reflection - 스프링. 파라미터 어노테이션에 자동 이름 부여가 안되는 오류 오류 상황 @GetMapping("/test") public String test(@RequestParam Integer data){ return "ok"; } 이 컨트롤러에 http://localhost:8080/test?data=10 요청시 java.lang.IllegalArgumentException: Name for argument of type [java.lang.Integer] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag. 오류가 터지며 응답이 안된다. 원인 원래는 자동으로 변수 이름이 @RequestParam.. 2024. 1. 31.
Parameter 0 of constructor in 컨트롤러 클래스 required a bean of type '클래스 이름' that could not be found. 스프링 에러 빈이 정상적으로 등록되지 않았을때 발생하는 문제다. 문제 원인은 대부분 다음과 같다. 1. @Service, @Repository 같은 어노테이션을 안붙임. 2. @Component 을 붙여주거나 직접 @Configruation 클래스에서 @Bean 어노테이션을 이용해 빈으로 등록 3. Application 실행 클래스 하위 패키지에 빈 클래스를 생성 -> 내 케이스 나는 3번의 케이스, 즉, @ComponentScan 대상이 아닌 패키지에 클래스를 생성한 것이 문제였다. 2024. 1. 27.