Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could

使用前端

因为给前端作分页java

在启动消费者的时候遇到了这个问题git

Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.github

Reason: Failed to determine a suitable driver classspring

 

 因为使用分页依赖spring-boot

<!--分页依赖-->
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>

  致使须要配置数据源,可是咱们消费者是不须要配置的ui

那么咱们就须要在启动类中增长注解禁止掉驱动数据源 url

添加exclude = DataSourceAutoConfiguration.class
@SpringBootApplication(scanBasePackages = "com.clx.myshop",exclude = DataSourceAutoConfiguration.class)
public class MyShopServiceUserConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(MyShopServiceUserConsumerApplication.class, args);

    }
}
相关文章
相关标签/搜索