-
[스프링부트/인텔리제이] java.lang.IllegalArgumentException : Ensure that the compiler uses the '-parameters' flagerror 2025. 1. 30. 13:12
@GetMapping("/{itemId}") public String item(@PathVariable long itemId, Model model) { Item item = itemRepository.findById(itemId); model.addAttribute("item", item); return "basic/item"; }
java.lang.IllegalArgumentException: Name for argument of type [long] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
스프링 부트 3.2부터 자바 컴파일러에 -parameters 옵션을 넣어주어야 애노테이션의 이름을 생략할 수 있다
1. IntelliJ IDEA > File > Settings를 연다
2. Build, Execution, Deployment > Compiler > Java Compiler로 이동한다
3. Additional command line parameters라는 항목에 "-parameters"을 추가한다4. out 폴더 삭제 후 재실행한다
정상작동 확인 728x90'error' 카테고리의 다른 글
[ IntelliJ/SpringBoot ] 메세지 국제화, 인코딩 문제 (1) 2025.02.02 [스프링부트/intelliJ] finished with non-zero exit value 1 (0) 2025.01.28 [스프링부트/intelliJ] Unable to start embedded Tomcat (0) 2025.01.12 [mac/스프링부트/intelliJ] .../.gradle/caches/8.11.1/groovy-dsl/ee4b830a1c754b6f6cc2bbd9b43341fb/metadata.bin (No such file or directory) (0) 2025.01.11 [JAVA] java.io.IOException: Stream closed (0) 2023.04.21