강의

멘토링

로드맵

Inflearn brand logo image

인프런 커뮤니티 질문&답변

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon

작성한 질문수

Spring Boot와 React로 배우는 초간단 REST API 게시판 만들기

Spring Boot 초기 세팅

스프링 기동 하는 부분에서 계속 에러가 나와서 질문 드립니다.

해결된 질문

작성

·

54

·

수정됨

0

안녕하세요. 스프링 기동 부분에서 에러가 나와서,

자바 버전도 바꾸어 보고, 인텔리제이도 최신 버전으로 업데이트 하고 , 여러 가지 시도를 해보는데, 문제가 해결이 안되고 있습니다.

여기 에러 로그를 남겨 봅니다.

 

참고로 그래이들 빌드시엔 에러가 안 나오지만, 소스의 메인 메서드를 실행하면 에러가 나옵니다.

 

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

2025-06-25T19:32:28.071+09:00 ERROR 10688 --- [prac] [ 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).

> Task :restapi.prac.PracApplication.main() FAILED

Execution failed for task ':restapi.prac.PracApplication.main()'.

> Process 'command 'C:\Users\jjhgw\.jdks\openjdk-24.0.1\bin\java.exe'' finished with non-zero exit value 1

* Try:

> Run with --stacktrace option to get the stack trace.

> Run with --info or --debug option to get more log output.

> Run with --scan to get full insights.

> Get more help at https://help.gradle.org.

BUILD FAILED in 14s

3 actionable tasks: 2 executed, 1 up-to-date

답변 4

0

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon
질문자

문제 해결되었습니다.

인텔리 제이를 포함한 여러 가지 설정을 최신화 하고, 자바 설정을 위한 환경변수도 깔끔하게 정리하고, 강의에서 처럼 프로젝트를 열 때,

build.gradle을 지정해서 프로젝트를 열어보니, 해결이 되었습니다. 스프링은 정말 민감한 프레임워크이군요. 미세한 설정이나 조작에 따라 생각치도 못한 문제가 튀어나오는군요..

 

영넨님의 프로필 이미지
영넨
지식공유자

해결되서 다행입니다!! 추가적으로 문제가 있으시다면 질문 주세요!

0

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon
질문자

추가 로그 정보 입니다.

 

 

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] FAILURE: Build failed with an exception.

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * What went wrong:

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] Execution failed for task ':restapi.prac.PracApplication.main()'.

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Process 'command 'C:\Program Files\Java\jdk-24\bin\java.exe'' finished with non-zero exit value 1

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] * Try:

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Run with --stacktrace option to get the stack trace.

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] > Get more help at https://help.gradle.org.

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger]

2025-06-25T20:18:45.557+0900 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 4s

0

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon
질문자

이 방법으론 해결이 안되네요..

-1

안녕하세요, 인프런 AI 인턴입니다. Jang Jaehoon님.

스프링 애플리케이션 기동 시 발생하는 APPLICATION FAILED TO START 오류는 데이터 소스 구성 오류 때문인 것으로 보입니다. 주로 데이터베이스 URL 설정이 누락되거나, 적절한 JDBC 드라이버 클래스가 포함되어 있지 않을 때 이런 오류가 발생할 수 있습니다. 아래 몇 가지 확인 사항을 통해 문제를 해결해보세요.

  1. application.properties 또는 application.yml 파일 확인:

    • 데이터베이스 관련 설정이 제대로 되어 있는지 확인하세요. 예를 들어, spring.datasource.url, spring.datasource.usernamespring.datasource.password 등이 포함되어 있어야 합니다.
    • 예시:
      
      spring.datasource.url=jdbc:mysql://localhost:3306/yourDB
      spring.datasource.username=yourUsername
      spring.datasource.password=yourPassword
      spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
      

  2. dependencies 확인:

    • 프로젝트의 build.gradle 파일에서 적절한 JDBC 드라이버가 추가되었는지 확인하세요. MySQL을 사용하는 경우 다음과 같은 의존성을 추가해야 합니다.
      
      dependencies {
       implementation 'mysql:mysql-connector-java'
      }
      

  3. 프로파일 설정 확인:

    • 특정 프로파일에서 데이터베이스 설정을 로드하도록 되어있다면, 그 프로파일이 활성화 되어 있는지 확인하세요. --spring.profiles.active=[profileName] 옵션으로 실행 가능합니다.
  4. 로컬 데이터베이스 동작 확인:

    • 데이터베이스 서버가 실제로 작동 중인지 확인해주세요.
  5. 에러 로그 분석:

    • IntelliJ IDEA의 “Run with –debug enabled”로 자세한 로그를 확인하고 문제의 원인을 찾는 데 도움이 될 수 있습니다.

이런 문제에 대해서 이미 유사한 질문이 존재하고 도움이 될 수 있습니다:
- Spring Boot 데이터베이스 설정 문제 해결

위의 방법을 시도해보고도 문제가 해결되지 않으면, 오류 메시지를 바탕으로 추가적인 정보를 주시면 더 구체적인 도움을 드릴 수 있습니다.

저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다. 현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏 추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon
질문자

여기 방법들로는 해결이 안되네요.. 참고로 자바 24 버전, 스프링부트 3.5.3으로 프로젝트 생성해서 하는데도 안되네요. 환경변수 설정도 틀리지 않았는데, 대체 왜 이런건가....

Jang Jaehoon님의 프로필 이미지
Jang Jaehoon

작성한 질문수

질문하기