본문 바로가기
개발/JAVA

Name for argument of type [org.springframework.web.multipart.MultipartFile] not specified, and parameter name information not available via reflection. 해결방법

by 유우웁 2024. 11. 27.
반응형

오늘은,, 

이미지 업로드하는 페이지를 만들어서 내 로컬에서는 잘 작동을 했다.

근데, 소스를 합치면서 팀원의 소스에서 오류가 발생했다.

- 원인

Name for argument of type [org.springframework.web.multipart.MultipartFile] not specified, and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag

파라미터 명이 명확하지 않다는 소리인데,, 구글링 하던 중 2가지 방안이 있었다.

 

- 해결방법

해결방안 1)  File > Settings > Build, Excution, Deployment > Java Comiler

> -parameters 넣고, Apply 적용하기

넣긴했지만,, 오류는 동일했음.

(오류가 동일해도 해당 셋팅값을 넣는 것 추천. [해결방안 1]을 안하고 [해결방안 2]로 했을 때, Ensure that the compiler uses the '-parameters' flag  오류 발생했음.)

 

해결방안 2)

@Param을 하라는 글이 있어서 해봤다.

 

해결완료,, 다들 Mapper에서 @Param을 잘 넣어주자,,,

반응형