Question

Caught unhandled exception: java.lang.RuntimeException: org.apache.http.conn.HttpHostConnectException

Hi,

Below REST endpoint URL over the Internet works fine when I test it from browser or Postman.
http://dummy.restapiexample.com/api/v1/employees

However when I test it from Pega Connect REST wizard on Pega 8.1, I am getting below error.
Caught unhandled exception: java.lang.RuntimeException: org.apache.http.conn.HttpHostConnectException: Connect to 192.168.1.100:9999 [/192.168.1.100] failed: Connection timed out: connect

I know there are quite a few problems with proxy around 7.3 but does this error have something to do with proxy? Please let me know.

Thanks,

Correct Answer
May 12, 2019 - 2:35am

I am very sorry. I just figured that the below JVM option that I was testing for Connect REST last year was still in the setenv.bat file in my Tomcat environment and that was causing this issue.

-Dhttp.proxyHost=192.168.1.100 -Dhttp.proxyPort=9999 -Dhttp.nonProxyHosts="192.168.1.1" 

I just removed above setting and it started to work fine.

Thanks,

Comments

Keep up to date on this post and subscribe to comments

May 11, 2019 - 8:00am

If you use postman from the same machine where your Pega is running (or a curl command to the url from the Pega host machine), does it work? Is your environment inside the company firewall with any proxy servers in between? The outcome of the curl command can tell you a lot.

May 12, 2019 - 2:25am
Response to KevinZheng_GCS

Yes, I am testing in the same machine. Pega 8.1 is installed on my machine itself. However browser or postman works but Pega fails, and I don't understand why.. Please see below screenshot.

[Works with browser]

[Fails with Pega]

I am using my home Internet environment and there is no firewall, nor am I using any proxy for my browser. I also tried my mobile WiFi but the result was the same.

Thanks,

May 12, 2019 - 2:35am

I am very sorry. I just figured that the below JVM option that I was testing for Connect REST last year was still in the setenv.bat file in my Tomcat environment and that was causing this issue.

-Dhttp.proxyHost=192.168.1.100 -Dhttp.proxyPort=9999 -Dhttp.nonProxyHosts="192.168.1.1" 

I just removed above setting and it started to work fine.

Thanks,

November 6, 2019 - 4:02am
Response to CloeW938

Hi , could you please give more details on changes you did in JVM option as i am also facing the same issue?