에러뜨는데 이유가 궁금합니다 ㅜ
6831
작성한 질문수 4
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
[2m2021-08-17 14:33:56.743[0;39m [31mERROR[0;39m [35m28676[0;39m [2m---[0;39m [2m[ restartedMain][0;39m [36mo.s.b.d.LoggingFailureAnalysisReporter [0;39m [2m:[0;39m
***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to bind properties under 'spring.datasource' to javax.sql.DataSource:
Property: spring.datasource.driver-class-name
Value: com.mysql.cj.jdbc.Driver
Origin: class path resource [application.properties]:4:37
Reason: Failed to load driver class com.mysql.cj.jdbc.Driver in either of HikariConfig class loader or Thread context classloader
Action:
Update your application's configuration
위처럼 에러가뜹니다 ㅜ 깃허브 올려주신거보고 그대로 가져와서 실행했는데 ㅜ 에러가나네요 혹시 어떤문제인지 짐작이 가시는지 궁금합니다~!
답변 1
0
제가 오늘 github에 올여놓은 master 소스로 해보았는데 잘되네요.
동일한 상황인데 안되는거라면..
pom.xml에 아래 디펜더시를 추가해주시구
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
application.properties 프로퍼티 내용을 아래로 변경
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
spring.datasource.url = jdbc:mariadb://localhost:3306/example
spring.datasource.username = example
spring.datasource.password = example
위 프로퍼티 정보는 로컬이나 db에 세팅한 정보로 입력하셔야 합니다.
만약 mysql 이라면 아래처럼 기재
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/example
그리고 기존에 만들었떤 DatabaseConfiguration.java 파일은 삭제
기존에 올렸던 방식은 java configuration을 통해서 datasource를 생성하는거였는데요.
위에 기재한 방식은
spring-boot-starter-jdbc를 활용해서 자동으로 datasource가 생성되는 방식으로 변경하는 방식인데요
한번해보시길 바랍니다.
제가 직접해보고 잘되는거 확인되고 답변드려요.
2강 Board.xml에 만들 때 오류를 어떻게 해결해야 하나
0
8834
1
E03 Swagger 설치 + 게시판 API 문서화
0
385
0
E04 참고
0
347
1
3강 Swagger 컴파일 에러
0
580
0
API 연동에 필요한 프로퍼티 관리와 사용방법에서 facebook.properties도 추가하려면 코드를 어떻게 작성해야 하나요?
0
251
0
용두사미
1
442
0
스웨거시 컴파일 에러는 안나는데 실행하면 에러가 나네요?
0
395
1
됐다가 안됐다가 쩝!
0
410
0
강의가 안됩니다.
0
763
0
마리아디비
0
309
0
application.properties
0
306
0
spring boot version
0
371
1
부트 로그인 화면
0
351
0
logger.info 질문입니다
0
467
1
강사님. 코드관련 질문드립니다.
0
428
1
컨텐츠가 2개로 나오는데 어느부분을 확인해야할까요?
0
350
0
강의 질문드립니다 [ApplicationContext]
0
482
1
아무리해봐도 해결이되지않네요 ㅠ
0
509
1
레포지토리 검색을 못한다네요 ㅠㅠ
0
6707
1
2강에 setMapperLocations 에 에러
0
814
1
주석 단축키가 뭔가요
0
582
1
E03 영상 관련.
0
383
1
질문드립니다
0
393
1
1
0
180
0





