SyntaxHighlighter.all(); [에러잡기] No suitable driver found for jdbc:log4jdbc://디비서버주소 :: 게을러지고 싶어 부지런한 개발자

어느날 잘 돌아가던 프로젝트에서 아래와 같은 에러가 떴다.

 

심각: Servlet.service() for servlet [appServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: No suitable driver found for jdbc:log4jdbc:mariadb://localhost:8080...

 

메시지 문구를 보면 log4jdbc를 인식하지 못한다고 의미.

 

문제의 원인은 org.mariadb.jdbc.Driver 대신에 log4jdbc.driver를 쓸 수 있도록 하는 속성이 빠졌기 때문!
log4jdbc.log4j2.properties 파일에 들어가서 아래 내용 중 빠진 것이 있다면 넣어주고 다시 실행해보자!

 

<!-- log4jdbc.log4j2.properties --> 
log4jdbc.drivers=org.mariadb.jdbc.Driver
log4jdbc.spylogdelegator.name=net.sf.log4jdbc.log.slf4j.Slf4jSpyLogDelegator

 

 

+ Recent posts