Languages

Spring Boot - java.net.ConnectException: Connection refused: connect - APR enabled / Tomcat native libraries

9 points
Asked by:
Indira
499

What is the reason why my Spring Boot Application doesn't let to establish socket connection via Jsoup or java URL class when I have enabled APR / Tomcat native libraries?

Exception message:

When I use Google Chrome Browser it works.

Used Spring Boot 2.4.

Stack trace:

1 answer
2 points
Answered by:
Root-ssh
178180

It looks like you don't have bound/selected IP addresses that are accepted to get a connection.

Add following configuration inside resources/application.properties file:

Where: 0.0.0.0 means: anyone is able to get a connection.

If you want to select only specific IPs that are able to get connection, change 0.0.0.0 to the desired address.

See also

  1. Spring Boot - public HTTP access to spring boot application

0 commentsAdd comment
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join