Can an application server(not on local computer) call itself with http://localhost?
I've been trying to resolve an issue at my new job. I still don't have access to a lot of their systems. There's an RDF report that's supposed to be called and then it is saved as a pdf file.
Here's small part of the code -
URL url = new URL("http://localhost:7777/reports/rwservlet?csc&report=/app/oracle/files/TCP01/reports/vp_owner/letter.rdf&P_USER=null&p_emp_id=12345");
URLConnection conn = url.openConnection();
(I manually inserted the URL link for readability)
Another piece of code checks for contenttype text/html - if it is text/html it throws an exception because it was expecting binary pdf data instead.
My main question is - Can a Production App Server call itself with an "http://localhost:7777" call?
I'm thinking that the contenttype is text/html because a 'Page cannot be displayed' is being sent back - because it can't resolve the localhost. Would this be true?
Is localhost only used for local machines like the application server on your desktop?
Thanks
Re: Can an application server(not on local computer) call itself with http://localhos
What status code is returned with the message: 'Page cannot be displayed'
Are you sure the path info on the url is correct? What do you get back if you use a valid host address with the path info you show in a browser from another site?
Re: Can an application server(not on local computer) call itself with http://localhos
Quote:
Originally Posted by
Norm
What status code is returned with the message: 'Page cannot be displayed'
Are you sure the path info on the url is correct? What do you get back if you use a valid host address with the path info you show in a browser from another site?
I don't even have access to production(only the logs) and I can't reproduce the issue in DEV and QA. I just want to know whether or not http://localhost is supposed to loopback to the web server where the application server is installed. At my last job I was used to dealing with proxy mappings for all the servers.
Re: Can an application server(not on local computer) call itself with http://localhos
How/where are you seeing the error message: 'Page cannot be displayed'
Most error messages have a status code sent with them in the first line of the response header.
Re: Can an application server(not on local computer) call itself with http://localhos
Quote:
Originally Posted by
Norm
How/where are you seeing the error message: 'Page cannot be displayed'
I think a page cannot be displayed is being sent back. But I'm not sure as I don't have access to production yet. The end user does not see the page because this is a background job. The saved pdf gets displayed in some other part of the application.
I'm more curious about this localhost call as I have never seen it being used on a production server ever before - I'm used to seeing mappings used instead.
Re: Can an application server(not on local computer) call itself with http://localhos
Quote:
I think a page cannot be displayed is being sent back.
What is the status code that is sent with that error message?
Re: Can an application server(not on local computer) call itself with http://localhos
I'm confused a bit about a few issues. Is your code being called from the same machine as the server? Does your server use port 7777 for its http service? What is the status code you are receiving (see HttpURLConnection.getResponseCode())?