java.security.PrivilegedActionException

0
I am getting an error while calling an API locally. The same API is working fine in Postman. Please help me how to resolve this.
asked
1 answers
1

The issue is in the httpHostConnection, that states that there was a time out.

As described here https://stackoverflow.com/questions/43372676/connection-failed-timeout-for-testing-api-using-java-apache-http-client there are 3 options that couold cause this:

  1. The URL expects headers like User-Agent. You can set request headers needed 

  2. You are in a corporate or restricted environment and need a proxy to connect to external URLs. Your browser might already be setup to use proxy server. In this case, you will need to pass proxy credentials to http client API.

  3. All outgoing requests are blocked in your environment by firewall or something. In this case, you will need to ask your network admin to allow network connection.

answered