Results 1 to 9 of 9
Thread: URL connection problem
- 04-23-2009, 04:54 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 7
- Rep Power
- 0
URL connection problem
Hi,
I am trying to connect and read a file using java URL.
url = new URL("my url is does not have any www or .com s");
URLConnection conn = url.openConnection();
conn.connect();
InputStream inStr = conn.getInputStream();
...
This is throwing exception FileNotFoundException: "my url with www and com"
But the given URL is different from the one is showing exception. I mean the www and com is added in the url.
Why this is happenning. The input url is opening in web browser.
I also tried to open the second url i.e with www and com, but giving 404 not found error.
How can i solve this problem...
Thanks inadvance..
- 04-23-2009, 05:25 PM #2
Member
- Join Date
- Apr 2009
- Location
- Brisbane
- Posts
- 86
- Rep Power
- 0
post the exact URL's... surely you can't expect intelligent answers if you withhold obviously pertinant information.
Whilste we can read minds we try to refrain from doing so whenever possible, as we've discovered that it perturbs the management.
- 04-23-2009, 05:43 PM #3
- 04-23-2009, 06:04 PM #4
Member
- Join Date
- Apr 2009
- Location
- Brisbane
- Posts
- 86
- Rep Power
- 0
- 04-23-2009, 06:05 PM #5
Member
- Join Date
- Apr 2008
- Posts
- 7
- Rep Power
- 0
I am not able to post URL in my message, it is giving error.
- 04-23-2009, 06:10 PM #6
Member
- Join Date
- Apr 2009
- Location
- Brisbane
- Posts
- 86
- Rep Power
- 0
- 04-23-2009, 06:18 PM #7
Member
- Join Date
- Apr 2008
- Posts
- 7
- Rep Power
- 0
It is something like, //xyz/abc/123.txt, but it is showing in exception is www . xyz . com , I can not post exact url, it is internal to my cmpny
- 04-23-2009, 06:19 PM #8
Member
- Join Date
- Apr 2008
- Posts
- 7
- Rep Power
- 0
assume that http: is there at the beginiing..
- 04-23-2009, 06:22 PM #9
Member
- Join Date
- Apr 2009
- Location
- Brisbane
- Posts
- 86
- Rep Power
- 0
Well I can almost assure you that it's not a valid URL.
Read the URL API...
http: //java.sun.com/javase/6/docs/api/java/net/URL.html
I find it terribly confusing myself... poorly written, as in only makes sense to people who already understand it; who aren't the ones reading the document trying to work-out how to use the bluddy thing!
Similar Threads
-
Too many Connection Problem Plz Help
By shuvra_pan in forum Advanced JavaReplies: 3Last Post: 03-17-2009, 01:42 PM -
small problem in connection
By BsBs in forum CLDC and MIDPReplies: 1Last Post: 01-27-2009, 06:03 AM -
jdbc connection problem
By Assaf A in forum JDBCReplies: 0Last Post: 12-01-2008, 05:08 PM -
connection problem
By subash in forum JDBCReplies: 5Last Post: 04-22-2008, 09:17 AM -
Sql server connection problem
By tanvirtonu in forum JDBCReplies: 1Last Post: 03-31-2008, 12:46 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks