All,
I've got a situation where two sites on the same server, with the same configuration and code are behaving differently. I'm thinking it must have to do with network setup, but I'm not sure where to begin looking.
We have a
JSP page that is using a class we developed to open an HttpUrlConnection. The connection is to "itself".
That is,
www.abc.com/foo.jsp -> foo.jsp is using our "scrape" library to open another page on
www.abc.com, 'scrape' the screen, stick it in the database, where it enters an email queue, and is eventually emailed.
This all works fine on *one* of our deployed sites, but pretty much none of the others... except all the other sites are exactly the same code, and configured in the same way, running on the same instances of apache,
tomcat, etc.
The platform is slackware 9.
In my /etc/hosts file, I don't have any entries for the sites in question (so it's not getting any help there). From the shell of the server that is running tomcat, I can ping and telnet to all of the sites.
I can also access the scraped JSP page directly from a browser (so there is no trouble with the page being scraped). But when a JSP page tries to access the JSP page through our scraping library, we get the following trace:
The next line in this stack trace is the JSP page that is attempting to scrape another JSP page. The code in the calling JSP page looks like:
The first parameter is so I can retrieve the jsessionid, the second parameter is the
url to scrape. 3rd and 4th parameters are the begin and end of scraping, and if null, then "whole page". The code in our library is, in part:
(line 142 is the last one)
I think my real question is: What does HttpURLConnection use to resolve "www.abc.com" ? Because in once of our sites, it appears to find it, and in pretty much none of our other sites (using the same code) does it find it. Or finding it, it is "refused".
I think where I'm really stuck is that I can telnet to *all* sites, but the code can't seem to do the same.
[ January 26, 2005: Message edited by: Mike Curwen ]