This is it. it's IT.

Name for argument type [java.lang.String] not available, and parameter name information not found in class file either. 본문

카테고리 없음

Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.

응애개발자 애기 2021. 11. 15. 14:59
728x90
반응형

https://m.blog.naver.com/sm_woo/70185755273

 

spring / Spring @MVC을 쓸 때, java compile option에 따라서 오류가 날수도 있다?

문제 상황)Spring @MVC를 사용하고, 아래와 같이 name 요청 파라미터를 받아 처리하는 간단한콘트롤러 ...

blog.naver.com

 

파라미터를 제대로 인식하지 못해서 생기는 오류라고 한다. 

pom.xml 설정을 바꾸면 

@RequestParam()을 생략하면서 코딩할 수 있다. 

 

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <debug>true</debug>
                    <compilerArgument>-Xlint:all</compilerArgument>
                    <showWarnings>true</showWarnings>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>

 

 

 

 Request processing failed; nested exception is java.lang.IllegalArgumentException: Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.

 

아 익진짜 오늘 개고생햇음

 

/*model.addAttribute("c_detail",service.c_detail(p_name,email));*/

이렇게하면 타입 오류 나는 이유 : 첨에 매퍼에서 리절트타입 VO로 줬으니까 매개변수도 List<VO>에 담아서 같이 보내줘야한다는것이;;;;ㅇ

 

List<ProductVO> test = service.c_detail(p_name,email);
model.addAttribute("c_detail",test);

이런식으로 해야 맞는거임;;

728x90
Comments