Molina, Teresa wrote:
I'm experiencing a problem with the response code (and body) returned after
HttpClient tries to execute a (get) method on an unknown host. If the host
had previously been in DNS and returned a valid (200, eg) response code,
subsequent attempts to execute still return that same code and body,
although the host is actually unavailable. All instances of the client
object will continue to return the same 200 response until the servlet
container has been restarted; after the restart, the client does throw the
expected unknown host exception.

Teresa,


This sounds like DNS caching to me. By "unavailable" you mean the host has no DNS entry but is still up and running under the same IP as when it was "available"?
The java.net.InetAddress class does DNS caching. Prior to JDK 1.4 there is no way to clear the DNS cache, you need to set some System properties to limit the DNS cache time. From 1.4 on these limits have better default values.


For 1.3 I usually set the System Properties
sun.net.inetaddr.ttl
sun.net.inetaddr.negative.ttl
to a value of 5 each.

HTH

Odi
--
_________________________________________________________________
 NOSE applied intelligence ag
                                   [www]      http://www.nose.ch
 ortwin glück                      [email] [EMAIL PROTECTED]
 hardturmstrasse 171               [pgp key]          0x81CF3416
 8005 zurich                       [office]      +41-1-277 57 35
 switzerland                       [fax]         +41-1-277 57 12


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to