Cannot get a response from server as I get a Unauthorised message
Have a Java program which simply connects to a server and gets back the response from the website.
When I use it under Windows environment it runs fine and i receive a Response Code: 200, , Response Message: OK but in UNIX i get Response Code 401, Response Message Unauthorized In Unix I tried to ping the website using the ping command. ping <website> <website> is alive I use putty to connect to a Unix m/c. I don't have any permissions to install any programs so could not install any s/w so i could check if i were able to reach the website. Is it a Proxy Server related issue ? If yes how do i configure it ? |
HI barnrygravel Wel-come to LQ,
sorry but i am confuse.... Quote:
Quote:
How you run your program? |
I honestly don't know what you are doing... but anyway... what's the permissions settings for ping?
do this and tell us the output: Code:
ls -l $( which ping ) |
Hi sem007,
Thanks for the warm welcome! Sorry did not post clearly. Quote:
Ideally the Response code 200 is expected(http://www.w3.org/Protocols/HTTP/HTRESP.html) This happens in case its run on windows but when the same program is run on Unix a Response code 401 (Unauthorized) is returned. Quote:
Can simply login to Unix using Putty after specifying the required credentials. To compile & run the Java Program the usual commands javac and java are used.Had tried to use some Proxy settings (as I thought it might be because of it) too but was unable to do so. |
Hi eantoranz,
Thanks for the reply. Quote:
Code:
snv891!abmittal:~/test [107]> ls -l $( which ping ) |
That's not what I wanted.... I though you were using bash.
Can you get the ls -l for ping, wherever it is? |
Nevermind... I just saw it.
|
So what could be the problem ?
|
If you're getting HTTP response codes back, ping is definitely not the utility being called, if any, so there's no problem there. And since you're actually getting a valid HTTP response back, I don't think the problem is with your java app either.
Does the URL you're checking require authentication? Or is there a "very defensive security policy" on the webserver? Those are about the only two reasons for getting a 401: http://www.checkupdown.com/status/E401.html So either you typo'ed the credentials on your linux java app, or there is some security feature on the web server denying the linux version. |
All times are GMT -5. The time now is 04:11 AM. |