예외처리 및 문제점 해결

오류 -> org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
		 -> 바인딩된 session을 String에 저장하고 싶지만 형변환 오류를 일으킴
해결 -> String.valueOf(Object);

문제점 -> Date 시간표현이 에폭타임 1970/01/01 00:00:00을 기준으로 현재까지 흐른 시간을 sec단위로 표현
해결 -> LocalTime 사용

오류 -> org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: 
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: ORA-00936: missing expression
->
해결 -> mapper에 적용할 mapper 변수가 null이라 생김

오류 -> org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.tiles.impl.CannotRenderException: 행 [61]에서 [WEB-INF/views/common/layout.jsp]을(를) 처리하는 중 예외 발생
     -> jsp body 부분에서 잘못되어 tiles를 불러올 때 문제가 생김
해결 -> jsp 확인

오류 -> org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Current request is not of type [org.springframework.web.multipart.MultipartHttpServletRequest]: org.apache.catalina.connector
		 -> 1. 폼태그에 enctype="multipart/form-data" 를 넣지 않음
		 -> 2.컨트롤러에 Multipart라이브러리의 인터페이스를 선언했는데 multipart 값이 오지 않음
		 -> 3.Multipart라이브러리 설정(xml)들 중 오타나 경로지정이 잘 못 됐을 때

Uncaught ReferenceError

image.png

프로젝트 옮기고 다른 pc에서 import했을 때 파일이 안보이는 경우 - 외부 프로젝트 import 시 오류

  1. 프로젝트 파일에 가서 .setting, .project 삭제
  2. sts 실행
  3. 프로젝트가 비활성화 되어있어야하고 그 프로젝트 삭제(완전 삭제가 아닌 그냥 삭제)
  4. import → projects from folder of Archive

https://bamdal.tistory.com/entry/SPRING-외부-프로젝트-파일이-제대로-import-되지-않을-때

SpringBoot

오류 -> org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.spring.Ch04ThymleafApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'homeController' for bean class [com.spring.ex01.HomeController] conflicts with existing, non-compatible bean definition of same name and class [com.spring.ex00.HomeController]
해결 -> @Controller 중복 or @GetMapping 중복

KO_KR

오류