Failed to determine a suitable driver class
新版本用war 包上线了一个项目,但是因为没有使用DataSource 所以spring boot一直都在报错
***************************
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 (the profiles dev are currently active).
报错信息说明的很详细:就是在项目启动的时候在 resource目录下没有加载到配置信息;如果项目只是想简单的启动运行,不进行数据库操作可以在 启动类上做如下处理便可解决。
@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
(exclude= {DataSourceAutoConfiguration.class})
过滤调这操作就可以了