본문 바로가기

Develop/Java(jsp,jmf)

java.lang.IllegalArgumentException: argument type mismatch


여러가지 경우가 있겠지만..
저와 같은 경우가 있을수도 있으니 포스팅합니다~

jsp 등록페이지에서 input type = file 을 사용하게 되어 Bean 또는 VO 파일에 FormFile 타입을 명시하였습니다.
그런데 submit 으로 페이지 이동시 다음과 같은 에러가 났습니다~


 java.lang.IllegalArgumentException: argument type mismatch
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
 at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
 at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
 at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
 at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at kr.co.dmd.common.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Unknown Source)
[04:48:11] ERROR StandardWrapperValve:253 Servlet.service() for servlet action threw exception
java.lang.IllegalArgumentException: argument type mismatch
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
 at org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
 at org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
 at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
 at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
 at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1252)
 at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
 at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at kr.co.dmd.common.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:170)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879)
 at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
 at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
 at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
 at java.lang.Thread.run(Unknown Source)


에러가 난 이유 : 
form 객체에 인코딩 타입을 빼먹엇음..-_-;;
<form name="actFrm" method="post" action="" enctype="multipart/form-data">
기본적인것이지만, 실수는 눈에 안보이는법..ㅠ_ㅠ (특히 날이 밝아오는 새벽엔...;;)

오늘의 한마디 : 디버깅이 잘 안될땐 자고 일어나면 해결된다.