简体   繁体   中英

Spring Boot app on localhost: connection refused

I have a Spring Boot app which runs fine 80% of the time.

In the other 20% however, I get "refused to connect" errors on localhost. What I have tried:

  • changing ports
  • turning windows defender/firewall completely off
  • restarting

Nothing works. Then after a while when I keep the app running, it suddenly starts working again.

As you might know this is really bad for my workflow. I only have had this problem with Spring Boot apps.

But if I check the logs, when trying to connect nothing gets logged: these connection attempts don't even reach my app. I'm running on an embedded server under Windows 10.

It might be the server blocks incoming connections, and if so, why?

Everything here runs on localhost. Basically trying to open my spring boot app in chrome. Yet neither chrome nor anything on the local network can reach my spring boot app.

Any ideas where to proceed with this?

I have figured this one out, so turns out, if you're using Quartz for task scheduling, Quartz WILL block your incoming requests in some way until it handles all the triggers it was supposed to fire while the server was off. So the longer you waited between runs the longer you have to wait while Quartz fixes itself. The solution for local work is simply to turn Quartz off unless you're debugging Quartz itself.

Super weird, took me months to understand it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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