springcloud遇到的问题

本文记录了在使用Spring Cloud时遇到的版本冲突问题,详细描述了项目启动时因Spring Boot和Spring Cloud版本不匹配导致的ApplicationContextException异常。通过调整两者版本,使它们兼容,成功解决了问题。此外,还介绍了Eureka Server的配置,以及如何访问注册中心页面,和Eureka Client的配置情况。
摘要由CSDN通过智能技术生成

1.版本问题

项目启动时报错

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server........

由于springboot和springcloud版本不兼容导致

可以降低springboot的版本,也可以提高springcloud的版本

我原本用的Spring-Cloud版本

Greenwich.SR3

报错后更换为

Hoxton.SR1

然后正常运行

2.Eureka-server配置

server:
  port: 7001
eureka:
  instance:
    hostname: localhost  #服务注册中心实例的主机名
  client:
    register-with-eureka: false  #是否在eureka服务器上注册自己的信息以供其他服务发现,默认为true
    fetch-registry: false  #此客户端是否获取eureka服务器注册表上的注册信息,默认为true
    service-url:  #与注册中心通信地址
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

然后通过localhost:端口号          访问注册中心页面

3.Eureka-client配置

spring:
  application:
    name: springcloud-provider-dept  #注册到eu
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值