title: Java Webstart not working offline (NoRouteToHostException/UnknownHostException)
body: <p>I want to configure my webstart app/jnlp so that if no internet connection is available, it would start from cache. <strong>Nevertheless, when I disconnect from the internet, I always get a NoRouteToHostException or UnknownHostException exception, despite the configuration below.</strong></p>
  
  <p>I've set the offline-allowed and update tags/attributes properly I think; I cannot find the reason why webstart is still trying to lookup the host.
  I definitely do have the app cached from my previous start when I was connected.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jnlp spec="6.0+" codebase="http://cms.mydomain.com/sync/" href="myAppSync.jnlp"&gt;
  
  &lt;information&gt;
      &lt;title&gt;My App Sync&lt;/title&gt;
      &lt;vendor&gt;My Company&lt;/vendor&gt;
      &lt;homepage href="http://www.myapp.com/"/&gt;
      &lt;description&gt;Sync application for My App&lt;/description&gt;
      &lt;icon href="ATTico.png"/&gt;        
  
      &lt;!-- allow app to run without Internet access --&gt;
      &lt;offline-allowed/&gt;
  
      &lt;shortcut online="true"&gt;          
        &lt;desktop/&gt;
        &lt;!-- create menu item for this app under the major heading 'My App' --&gt;
        &lt;menu submenu="My App"/&gt;
      &lt;/shortcut&gt;
  
  &lt;/information&gt;
  
  &lt;security&gt;
      &lt;all-permissions/&gt;
  &lt;/security&gt;
  
  &lt;update check="timeout" policy="always" /&gt;
  
  &lt;resources&gt;
      &lt;java version="1.6*" href="http://java.sun.com/products/autodl/j2se"/&gt;
      &lt;jar href="lib/myAppSync.jar" /&gt;
      &lt;jar href="lib/apache-mime4j-0.6.jar" /&gt;
      &lt;jar href="lib/commons-logging-1.1.1.jar" /&gt;
      &lt;jar href="lib/commons-codec-1.3.jar" /&gt;
      &lt;jar href="lib/httpclient-4.0.1.jar" /&gt;
      &lt;jar href="lib/httpcore-4.0.1.jar" /&gt;
      &lt;jar href="lib/httpmime-4.0.1.jar" /&gt;
      &lt;jar href="lib/swingx-1.6.jar" /&gt;
      &lt;jar href="lib/swingx-beaninfo-1.6.jar" /&gt;        
  &lt;/resources&gt;
  
  &lt;application-desc main-class="com.myapp.sync.forms.Main"/&gt;
  
  &lt;/jnlp&gt;
  </code></pre>
  
  <p>Error log:</p>
  
  <pre><code>java.net.NoRouteToHostException: No route to host: connect
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.PlainSocketImpl.doConnect(Unknown Source)
  at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at sun.net.NetworkClient.doConnect(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.&lt;init&gt;(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
  at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
  at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
  at com.sun.javaws.Launcher.downloadResources(Unknown Source)
  at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
  at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
  at com.sun.javaws.Launcher.launch(Unknown Source)
  at com.sun.javaws.Main.launchApp(Unknown Source)
  at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
  at com.sun.javaws.Main$1.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  
  
  
  java.net.UnknownHostException: cms.mydomain.com
  at java.net.PlainSocketImpl.connect(Unknown Source)
  at java.net.SocksSocketImpl.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at java.net.Socket.connect(Unknown Source)
  at sun.net.NetworkClient.doConnect(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.openServer(Unknown Source)
  at sun.net.www.http.HttpClient.&lt;init&gt;(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at sun.net.www.http.HttpClient.New(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
  at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
  at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
  at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.isUpdateAvailable(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
  at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
  at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
  at com.sun.javaws.Launcher.downloadResources(Unknown Source)
  at com.sun.javaws.Launcher.prepareLaunchFile(Unknown Source)
  at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
  at com.sun.javaws.Launcher.launch(Unknown Source)
  at com.sun.javaws.Main.launchApp(Unknown Source)
  at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
  at com.sun.javaws.Main$1.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>