You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Tim C." <ti...@hotmail.com> on 2003/03/18 12:38:06 UTC

Re: Catching Exceptions from incorrect proxy setting

> >
> > I keep returning to the same problem of trying to find a way of allowing 
>a
> > user on the client side to determine proxy settings. It seems if they
> > define:
> >
> >    System.setProperty("proxySet", "true" );
> >    System.setProperty("http.proxyPort",8080);
> >    System.setProperty("http.proxyHost",wwcache.blah);
> >
> > before the first call is invoked it works. The problem comes when the
>wrong
> > proxy settings are given and the exception is caught. If the correct 
>proxy
> > settings are then tried and a second call made to the server then it 
>fails
> > with the same exception (java.net.UnknownHostException).
>
>
>the JRE caches hostname to IP mappings, possibly to stop you subverting
>applet security by fiddling with DNS records. However, they also cache
>negative entries, in complete violation of the DNS specification. They say
>"negative caching is used to improve performance.", but this is so bogus it
>hurts. Who cares about the performance hit of looking up nonexistent hosts.
>I have been burned by this on long-lived server code; upstream DNS goes 
>down
>for a bit and suddenly your server wont talk to the database till you
>restart it.
>
>Look up java.net.InetAddress for info on properties to set to control
>caching. These must be set *before* the JVM starts (on the command line),
>and they are different in Java1.4 from the prior versions, as are the
>defaults. Java1.4 claims a 10 sec cache on negative DNS, Java1.3 appears to
>hang on to negative lookups until shortly before the heat death of the
>universe.

Thanks I have tried setting both of these (networkaddress.cache.ttl & 
networkaddress.cache.negative.ttl) to zero from the command line and from 
within the code but this did not make a difference. Even if I delayed the 
second call >10 sec it did not connect given the correct proxys.

In Apache SOAP I used SOAPHTTPConnection.setProxyHost() and setProxyPort() 
to define (& re-define) proxys. Is there no equivalent way of setting the 
proxy in AXIS?

Tim

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger 
http://messenger.msn.co.uk