기록

spring 프로젝트_0831

coolcode 2022. 8. 31. 10:07

git lab 리파지토리 재생성 후 커밋

개인 프로젝트 일정표 작성

--------------------------------------------------------

mybatis와 spring db 연동

>> mybatis와 mybatis-spring 사용을 위해 pom.xml 내 dependency 추가 

- mybatis :: mybatis기본 lib

- mybatis-spring :: mybatis와 spring연동 lib

- spring-tx :: spring에서 database처리 및 transaction 처리 lib

- spring-jdbc :: spring에서 database 처리 lib

----------------------------------------------------------------------------------

** dependency 추가 후 root-context.xml 에서 sqlsessionfactory bean 추가하려고 했는데

namespace 에 xsd내역이 없어서 sts p2 repositories 만 재설치해서 sts 업데이트 함

** java 버전을 현재 버전에 맞게 build path 에서 잡아줘도 계속 J2SE-1.5 버전으로 변경 됨

>> 우선 버전 13 으로 통일해서 오류 잡아두었고 추후 문제 발생시 다시 확인

namespace xsd 오류 계속 해결 안되면 java config 로 우회 예정

++ pom.xml의 java 버전 설정이 잘못되어 있어서 root-context.xml 자체를 불러오지 못했는데

현재 사용버전(13.0.2) -> pom.xml의 java version 태그에는 13.0.2이 아닌 13으로 기재해야 함

build path와 complier 버전도 모두 13으로 맞추니 maven update 후에도 버전 유지됨

++ 위의 버전 이슈 해결 후에 root-context.xml 파일 open with > spring config editor 로 namespace 열어서 확인함

이후에는 정상적으로 바로 xml namespace 탭에서 확인 가능

(*이전 프로젝트 했을때랑 다른점은 namespace 아이콘이 다 S 로 같게 나온다)

----------------------------------------------------------------------------------------

root-context.xml 에 mysql 과 hikariconfig 연동하는 빈등록 중 발생 오류

오류 메세지 : The reference to entity "serverTimezone" must end with the ';' delimiter.

>> jdbc:mysql://localhost:3306/데이터베이스명?characterEncoding=UTF-8&serverTimezone=UTC

>> & 를  & 로 대체함