Eureka 启动报错 freemarker.core.InvalidReferenceException

在学习Eureka时遇到启动报错,具体表现为freemarker.core.InvalidReferenceException,错误源于'eureka/navbar.ftl'模板的第68行第62列,报错信息为replica.key未找到。解决方法包括检查并修正application.yml配置。
摘要由CSDN通过智能技术生成

学习 Eureka时候报错

freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> replica.key [in template “eureka/navbar.ftl” at line 68, column 62]

部署完毕之后这样

在这里插入图片描述
错误 application.yml

eureka:
  client:
    service-url:
      defaultZone: localhost:10000/eureka # url格式错了
    register-with-eureka
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
启动EnableEurekaServer时遇到org.springframework.beans.factory.BeanCreationException错误通常是由于配置问题或依赖项缺失引起的。以下是一些可能的解决方法: 1. 检查依赖项:确保在pom.xml文件中正确添加了所需的依赖项。特别是,确保已添加spring-boot-starter-web和spring-cloud-starter-netflix-eureka-server依赖项。 2. 检查配置:检查application.properties或application.yml文件中的配置是否正确。特别是,确保已正确配置Eureka Server的相关属性,如server.port和eureka.client.register-with-eureka。 3. 检查包扫描:确保@EnableEurekaServer注解位于Spring Boot应用程序的主类上,并且正确扫描了所有的包。 4. 检查端口冲突:如果在启动Eureka Server时遇到端口冲突错误,请确保所选的端口未被其他应用程序占用。 5. 检查日志:查看详细的错误日志以获取更多信息。日志通常会提供有关错误的更多上下文和堆栈跟踪信息,以帮助你定位问题。 以下是一个示例的启动EnableEurekaServer的代码: ```java import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; @SpringBootApplication @EnableEurekaServer public class EurekaServerApplication { public static void main(String[] args) { SpringApplication.run(EurekaServerApplication.class, args); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值