Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connected and Disconnected use of URL

 
Jeff Calusinski
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Jeff Calusinski
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic