寫項(xiàng)目的時(shí)候遇到報(bào)錯(cuò)信息
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).
在啟動(dòng)類在@springbootApplication上加入屬性
// exclude :?jiǎn)?dòng)時(shí)不啟用 DataSource的自動(dòng)配置
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@EnableEurekaServer // 表示它是服務(wù)注冊(cè)中心
public class EurekaServerMain7001 {
public static void main(String[] args) {
SpringApplication.run(EurekaServerMain7001.class,args);
}
}