Error occurs only in debug mode: 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.

Answered

So I'm attempting to run a Spring Boot application in debug mode from the IntelliJ IDE. When doing so I get this error, however it is only specific to debug mode. If I were to run the application from the terminal using the command ./gradlew bootRun, the application will start successfully. Error Below:


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.

Things I have tried during troubleshooting:
- Making sure the JDK on the run configurations are correct.
- Clearing the IntelliJ cache.
- In the run configurations, selecting the option to "Use the classpath of the module." then clicking Apply. I notice, when doing this, however, that this option is not retained. If I were to go back and look at the run configuration, it was as if I never selected the option to begin with.

- setting the following in my application.yaml: driver-class-name: org.postgresql.Driver

Any other suggestions on how I can troubleshoot this?

0
2 comments

Hello,

Please check related discussion: https://stackoverflow.com/questions/51221777/failed-to-configure-a-datasource-url-attribute-is-not-specified-and-no-embedd

If it doesn't help please provide sample project example for investigation.

0

ensure reload all maven projects:

0

Please sign in to leave a comment.