springboot集成nacos报错

启动报错内容



***************************
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).

bootstrap.yml


```c
spring:
  cloud:
    nacos:
      config:
        server-addr: 8.141.53.148:8848
        file-extension: yaml
        prefix: user
        group: zyj
  profiles:
    active: dev

nacos配置

img

pom.xml配置


```c
    <!--nacos-config-->
        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
            <version>2.2.7.RELEASE</version>
        </dependency>


https://blog.csdn.net/qq_37950196/article/details/108866752?spm=1001.2014.3001.5502

集成nacos项目本地要用bootstrap.yml ,nacos上配置的yml名称默认是你服务的名称加环境xxx-xxx-dev.yml。具体还可以指定加载环境等等。

bootstrap.yml配置写错了,profiles:active: dev,你nacos中都没有这个dev这个命名空间

img

img