Results 1 to 9 of 9
  1. #1
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default 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..

  2. #2
    corlettk is offline Member
    Join Date
    Apr 2009
    Location
    Brisbane
    Posts
    86
    Rep Power
    0

    Default

    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.

  3. #3
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    6

  4. #4
    corlettk is offline Member
    Join Date
    Apr 2009
    Location
    Brisbane
    Posts
    86
    Rep Power
    0

    Default

    Quote Originally Posted by PhHein View Post
    Keith: ... link ...
    Just another dirty stinking cross poster!

  5. #5
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default

    I am not able to post URL in my message, it is giving error.

  6. #6
    corlettk is offline Member
    Join Date
    Apr 2009
    Location
    Brisbane
    Posts
    86
    Rep Power
    0

    Default

    Quote Originally Posted by rajeshgubba View Post
    I am not able to post URL in my message, it is giving error.
    No problem... just put a space in it after the http:

  7. #7
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default

    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

  8. #8
    rajeshgubba is offline Member
    Join Date
    Apr 2008
    Posts
    7
    Rep Power
    0

    Default

    assume that http: is there at the beginiing..

  9. #9
    corlettk is offline Member
    Join Date
    Apr 2009
    Location
    Brisbane
    Posts
    86
    Rep Power
    0

    Default

    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

  1. Too many Connection Problem Plz Help
    By shuvra_pan in forum Advanced Java
    Replies: 3
    Last Post: 03-17-2009, 01:42 PM
  2. small problem in connection
    By BsBs in forum CLDC and MIDP
    Replies: 1
    Last Post: 01-27-2009, 06:03 AM
  3. jdbc connection problem
    By Assaf A in forum JDBC
    Replies: 0
    Last Post: 12-01-2008, 05:08 PM
  4. connection problem
    By subash in forum JDBC
    Replies: 5
    Last Post: 04-22-2008, 09:17 AM
  5. Sql server connection problem
    By tanvirtonu in forum JDBC
    Replies: 1
    Last Post: 03-31-2008, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •