I'm trying to get page content from a specific URL:
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
LOGGER.info("Response code: "+conn.getResponseCode();
... (rest of the code, not relevant at the moment) ...
I'm not able to get conn.getResponseCode()
, I have timeout before it gets printed. Surprisingly, when I put the very same URL in my browser, the page will be loaded correctly. I thought it may have something do to with HTTP/HTTPS, unfortunately, after changing HttpURLConnection
to HttpsURLConnection
there is no difference.
Maybe it has something to do with JBoss configuration? I use JBoss 7.1.1 Final.