简体   繁体   English

Spring 引导应用程序:net::ERR_CONNECTION_REFUSED

[英]Spring Boot application: net::ERR_CONNECTION_REFUSED

For a school project we are creating a Spring Boot application based on Restful.对于一个学校项目,我们正在创建一个基于 Restful 的 Spring 引导应用程序。 It works flawlessly locally, but once deployed to AWS I receive "net::ERR_CONNECTION_REFUSED" on all GET and POST requests I send to my RestController.它在本地完美运行,但一旦部署到 AWS,我在发送到 RestController 的所有 GET 和 POST 请求上都会收到“net::ERR_CONNECTION_REFUSED”。

If I just host my database on AWS it works fine locally, but as soon as I upload my project to an AWS instance it goes back to "net::ERR_CONNECTION_REFUSED".如果我只是在 AWS 上托管我的数据库,它可以在本地正常工作,但是一旦我将我的项目上传到 AWS 实例,它就会返回到“net::ERR_CONNECTION_REFUSED”。 I get no exception in Java.我在 Java 中也没有例外。

Does anyone have any idea about this?有人对此有任何想法吗? If so, I'd be more than grateful for the help.如果是这样,我将非常感谢您的帮助。 I can of course show any code you need to see to clarify anything, I'm just unsure which code would be relevant.我当然可以显示您需要查看的任何代码来澄清任何事情,我只是不确定哪些代码是相关的。

Thanks a lot, I hope you are all well.非常感谢,希望你一切都好。

I figured out the issue.我弄清楚了这个问题。 I was running both front end and backend in the same project which resulted in API calls from the very same project to ip:8080 was void.我在同一个项目中同时运行前端和后端,导致 API 从同一个项目调用 ip:8080 无效。 I hosted the backend on ip:9090 and the frontend on ip:8080 in order for it to work.我在 ip:9090 和 ip:8080 上托管了后端,以便它工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM