springcloud client启动失败,自动停止的可能原因及解决方法

可能原因:

1. 少加了依赖

2. 个别依赖添加的位置不对

解决方法:

1. 看看是不是少了如下依赖:

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

2. 检查上面的依赖是不是放错了位置,不要放在

<dependencyManagement>
    <dependencies>
     </dependencies>
</dependencyManagement>

我放在

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

的后面是没有问题的。

3. 如果是报错:“No active profile set, falling back to default profiles: default”,参考这篇文章解决:

https://blog.csdn.net/weixin_37705192/article/details/84777999

发布了26 篇原创文章 · 获赞 4 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/y_onghuming/article/details/102909198