-2

This is the Spring Boot project I downloaded:

enter image description here

Just after trying to run the application in Eclipse as Maven Build > Goals > spring-boot:run it is throwing up following errors;

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-08-29 13:15:23.664 ERROR 27072 --- [           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).

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:17 min
[INFO] Finished at: 2023-08-29T13:15:23+05:30
[INFO] Final Memory: 36M/328M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.7.15:run (default-cli) on project Spring-boot-login: Application finished with exit code: 1 -> [Help 1]
[ERROR] 

Why is a freshly downloaded project failing?

jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
  • 3
    It says why: you need to configure a data source. See e.g. https://spring.io/guides/gs/accessing-data-mysql/ – jonrsharpe Aug 29 '23 at 09:04
  • As the duplicate and @jonrsharpe mentioned, you included the dependencies to work with a `DataSource`, but you didn't configure it (which at least means you didn't include a `spring.datasource.url` property that contains the location of the MySQL database). For that reason, your application cannot start. – g00glen00b Aug 29 '23 at 09:05

0 Answers0