聚合项目的客户端报错:dataSource没有被找到的错误

    xiaoxiao2022-07-07  203

    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)  

    解决方法:启动项修改注解:

    @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})

    此注解的意思是排除自动注入数据源的配置(也就是取消数据库配置),一般用于客户端(不需要数据源,数据源通过服务端的Restful接口提供)

     
    最新回复(0)