首页 > 解决方案 > 错误:连接 ECONNREFUSED 127.0.0.1:8080(Spring 框架)

问题描述

我正在使用 spring 框架,当我尝试向邮递员注册用户时,我一直在控制台中收到此错误,所以我无法注册用户

POST http://localhost:8080/api/auth/signup
Error: connect ECONNREFUSED 127.0.0.1:8080
Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.25.0
Accept: */*
Postman-Token: c8f92e31-e8f6-40d9-90b0-2bd4faba0552
Host: localhost:8080
Accept-Encoding: gzip, deflate, br
Connection: keep-alive

Request Body
{
    "username":"TestUserX",
    "email":"TestUserX@bla.com",
    "password":"password1"
}

标签: javaspringspring-bootspring-mvcspring-security

解决方案


我的模型中缺少 @Entity 注释,这导致服务器出现故障。另外,我没有正确映射一些变量。原来弹簧注释真的很重要:)


推荐阅读