File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Connected and Disconnected use of URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Connected and Disconnected use of URL" Watch "Connected and Disconnected use of URL" New topic
Author

Connected and Disconnected use of URL

Jeff Calusinski
Greenhorn

Joined: Apr 21, 2005
Posts: 6
I am writting a client side application that will be running while the user is connected and disconnected to the company VPN. One of the UI pages allows for images to be shown on the screen. The images are retrieved from the company webserver.

Everything works well when the user starts the application while the VPN is running. But if the user starts the application while the VPN is not up and then starts the VPN, but doesn't restart the java application, Exceptions are generated by the URL object.

The exceptions indicate it can not resolve the domain name. If I stop the application and restart it, then everything works.

I have tried to change the networkaddress.cache.negative.ttl property in java.security.Security to 0 so that negative look ups never get cached, but that doesn't work.

So.. How do I prevent the URL class from caching network interfaces, or allow for dynamic discovery of the interfaces?

Cheers
-Jeff
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
See if This Sun Article helps. From my notes of a prior similar experience when a partner switched their DNS to a standby server ...

[ December 19, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeff Calusinski
Greenhorn

Joined: Apr 21, 2005
Posts: 6
Thanks Stan.
I had Security.setProperty("sun.net.inetaddr.negative.ttl","0")
set but not
Security.setProperty("networkaddress.cache.ttl","0");

Looks like I needed both.

Cheers
-Jeff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connected and Disconnected use of URL