Skip to content

Improve FailureAnalyzer for embedded datasource #8029

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
snicoll opened this issue Jan 19, 2017 · 3 comments
Closed

Improve FailureAnalyzer for embedded datasource #8029

snicoll opened this issue Jan 19, 2017 · 3 comments
Labels
status: superseded An issue that has been superseded by another

Comments

@snicoll
Copy link
Member

snicoll commented Jan 19, 2017

The FailureAnalyzer for the embedded datasource is too focused on the embedded use case (that is the fallback to a proper configuration to a production database).

Say that you start an app with JPA and MySQL, this is what you get

***************************
APPLICATION FAILED TO START
***************************

Description:

Cannot determine embedded database driver class for database type NONE

Action:

If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

The link between MySQL and the embedded database isn't obvious at all actually. The action mentions "database settings" but the description doesn't. Perhaps we could be smarter and look in the environment?

If that exception is thrown, it means we've tried to auto-configure the DataSource. We can therefore safely assume that no spring.datasource.url was specified. Perhaps we should mention that in the description?

Actually, describing that we've tried to create an embedded database because no settings to configuration the database were found would be a good first start IMO.

@philwebb philwebb added the status: ideal-for-contribution An issue that a contributor can help us with label Jan 19, 2017
seolivas added a commit to seolivas/spring-boot that referenced this issue Jan 28, 2017
yeaxi added a commit to yeaxi/spring-boot that referenced this issue Aug 1, 2017
- refactor DataSourceBeanCreationException getMessage;
@snicoll
Copy link
Member Author

snicoll commented Feb 12, 2018

Closing in favour of PR #11953

@snicoll snicoll closed this as completed Feb 12, 2018
@snicoll snicoll added status: duplicate A duplicate of another issue and removed priority: normal status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement labels Feb 12, 2018
snicoll added a commit that referenced this issue Feb 12, 2018
* pr/11953:
  Polish "Improve FailureAnalyzer for embedded datasource"
  Improve FailureAnalyzer for embedded datasource
@ff-yzheng
Copy link

I am very new about Spring, but I got the following error:


APPLICATION FAILED TO START


Description:

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

Reason: Failed to determine a suitable driver class

is there any workaround here , like put configuration in application.properieties? Thank you for your help.

@snicoll
Copy link
Member Author

snicoll commented Mar 26, 2018

@ff-yzheng this issue is closed and we don't use the tracker for questions. Feel free to ask on StackOverflow or come chat with us on Gitter

@philwebb philwebb added status: superseded An issue that has been superseded by another and removed status: duplicate A duplicate of another issue labels Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

3 participants