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?