This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes General Computing and the fly likes Not able to connect to a host URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Not able to connect to a host URL " Watch "Not able to connect to a host URL " New topic
Author

Not able to connect to a host URL

Deepshan Shetty
Greenhorn

Joined: May 28, 2012
Posts: 28
Hi

I'm trying to connect to a URL (https://infinity.bank.co.in/AWAY) through my jsp.
But i get an exception like
exception in urlConnect-->java.net.UnknownHostException: infinity.bank.co.in

My code to connect is as follows


where VerifyResponseURL = https://infinity.bank.co.in/AWAY
and the URL is correct

Can i get a solution to this?

Regards
S V Shetty
Sumit Patil
Ranch Hand

Joined: May 25, 2009
Posts: 296

Are you sure the URL is correct?
For me, this URL is not opening up in Firefox.


Thanks & Regards, Sumeet
SCJP 1.4, SCWCD 5, LinkedIn Profile
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1449
    
    6

Does not work from chrome too.


Swastik
Deepshan Shetty
Greenhorn

Joined: May 28, 2012
Posts: 28
https://infinity.icicibank.co.in/BANKAWAY

This is the URL
John Jai
Bartender

Joined: May 31, 2011
Posts: 1776
If you are using a proxy to connect, set the proxy settings while opening the connection like below.

Deepshan Shetty
Greenhorn

Joined: May 28, 2012
Posts: 28
But I'm not using a a proxy :(

And i don have any IP address as such !
BalaMurali dhar
Ranch Hand

Joined: Apr 14, 2012
Posts: 60
Are you sure the URL is working? For me this is not Working
Deepshan Shetty
Greenhorn

Joined: May 28, 2012
Posts: 28
Yes..

Get the following exception

exception in urlConnect-->java.net.UnknownHostException: infinity.icicibank.co.in
java.net.UnknownHostException: infinity.icicibank.co.in
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:564)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:530)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1014)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:230)


Any idea why is this??

Can it happen if the URL is incomplete??
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Not able to connect to a host URL
 
Similar Threads
Unable / How to make Https request using Java
HttpsURLConnection ClassCastException Question
Overriding the Security Certificate
Not able to connect to a host URL
Communicating with HTTPS server with Client Authentication