• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    해결됨

spring factories 생성에서요..

18.11.06 19:34 작성 조회수 6.51k

0

스프링 프레임워크 공부하다가 라이브러리 생성하는게 전부 달라서 스프링부트 찾다가 강의를보게되었는데 인텔리j도 처음써보고 검색해도 이런문제를 찾을수가없어서 질문드려요

spring.factories 파일 생성하면 springboot에서 지원하는 파일모양으로 바뀌던데 그냥문서모양으로 만들어지고 자동완성기능도 없는거보니 그냥 아무상관없는파일같아서 어디를 설정해야되는지 모르겠습니다.. 그냥 무시하고 진행해서 실행하니 에러가 뜨네요.

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.

2018-11-06 19:19:02.445 ERROR 8148 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

APPLICATION FAILED TO START

Description:

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

Reason: Failed to determine a suitable driver class

Action:

Consider the following:

If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

Process finished with exit code 1

에러뜬곳부터 복사붙여넣기 한거입니다. 독학하는데 막히면 물어볼곳이 없어서 ..질문드려요

답변 1

답변을 작성해보세요.

3

그 파일 때문에 에러난게 아니라, 아마 pom.xml에 spring-boot-starter-data-jpa 라는 의존성을 넣었는데, DB관련 의존성을 넣지 않아서 에러가 난거 같습니다. spring-boot-starter-data-jpa 의존성을 삭제하거나, 위 메시지에서 제시하는대로 임베드 DB 라이브러리 중 아무거나 하나 추가하시면 저 에러는 사라질 거에요.