본문 바로가기
IT/Java

java.lang.IllegalArgumentException at java.sql.Date.valueOf(Date.java:141)

by 성준하이 2024. 4. 4.
반응형

Java 를 사용중에 아래와 같은 에러가 발생하였다.

 

java.lang.IllegalArgumentException at java.sql.Date.valueOf(Date.java:141)

 

전체 에러는 아래와 같다.

java.lang.IllegalArgumentException
at java.sql.Date.valueOf(Date.java:141)
at event.action.EventAddAction.execute(EventAddAction.java:27)
at event.action.EventFrontController.service(EventFrontController.java:25)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

 

결론은 Date 값 인자에 Date값이 안들어와서 그렇다.

 

rs.getString(1) .. 2 .. 3 

이렇게 넣다보니 바인딩 숫자를 헷갈려서 엄한 데이터를 Date에 넣으려니 발생한 에러였다.

반응형

댓글