Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Errors Reading from URL !!

Terry Prazak
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a small program that runs on a server and tries to connect to a certain URL to obtain information.
Problem 1:
I am using HTTP protocol but when I try to construct an URL object with an address like it throws an UnkownHostException. I can get around this by supplying the raw ip instead like
Is there another way to get around from having to supply the raw ip? I would rather use the domain name in case the ip changes on me.
Problem 2:
If I do use the raw ip then the next error that is thrown is FileNotFoundException. It seems that our provider for the http information i want to capture will not work if i replace the domain name with the raw ip. I can't explain this as I've tried both versions in a browser and the one with the raw ip just gives me a page not found error. Http:// --> WORKS Http:// -------> PAGE NOT FOUND
To get the raw ip I went to the command window and just typed in 'ping'
I could really use some help on this by anyone who might have some insight to this.
**What is funny is that on all the machines that I test this on they will accept the domain name in the URL constructor. THe only one that doesn't is the live machine which seems to want the ip instead.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic