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).
Disconnected from the target VM, address: ‘127.0.0.1:50440’, transport: ‘socket’
Process finished with exit code 1
解决办法:
①解决办法是重新clean——compile——package
②检查你的数据源是否能连接上,如果使用的配置中心,检查你的启动参数中的配置中心的URL地址是否正确(数据源环境太多的话,重点检查此项)
③在Spring boot的启动引导类上增加@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}),阻止Spring boot自动注入dataSource