개발중/Troubleshooting

com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI 에러잡기

Binsoo 2022. 7. 8. 10:20
728x90
반응형

 

빌드는 성공했는데 에러가 남

 

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

 

 

보면 알겠지만 에러는 아니고 com.mysql.jdbc.Driver가 옛날 버전이기 때문에 com.mysql.cj.jdbc.Driver로 바꿔달라는 내용인데

persistence.xml 파일을 확인해보면 이미지 가장 상단에 javax.persistence.jdbc.driver 부분의 value

com.mysql.jdbc.Driver로 되어있는데 이걸 com.mysql.cj.jdbc.Driver로 바꿔달라는 얘기다

 

persistence.xml 파일이 없는데 이런 내용의 로그가 온라온다 치면 mysql 설정을 잡아준 곳을 확인해주면 되는데

application.properties 파일을 확인해주면

 

변경 전

jdbc.driverClassName=com.mysql.jdbc.Driver 

 

변경 후

jdbc.driverClassName=com.mysql.cj.jdbc.Driver


 

변경 했더니 이런 에러가 다시 뜸

 

Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

 


m2 삭제하고 다시 시도시 성공


728x90
반응형