Java Webstart not working offline (NoRouteToHostException/UnknownHostException)

Discussion in 'Java' started by Mathias Lin, Sep 14, 2010.

  1. Mathias Lin

    Mathias Lin Guest

    I want to configure my webstart app/jnlp so that if no internet
    connection is available, it would start from cache. *Nevertheless,
    when I disconnect from the internet, I always get a
    NoRouteToHostException or UnknownHostException exception, despite the
    configuration below.*

    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.


    jnlp file:
    ==========

    <?xml version="1.0" encoding="UTF-8"?>
    <jnlp spec="6.0+" codebase="http://cms.mydomain.com/sync/"
    href="myAppSync.jnlp">

    <information>
    <title>My App Sync</title>
    <vendor>My Company</vendor>
    <homepage href="http://www.myapp.com/"/>
    <description>Sync application for My App</description>
    <icon href="ATTico.png"/>

    <!-- allow app to run without Internet access -->
    <offline-allowed/>

    <shortcut online="true">
    <desktop/>
    <!-- create menu item for this app under the major heading 'My
    App' -->
    <menu submenu="My App"/>
    </shortcut>

    </information>

    <security>
    <all-permissions/>
    </security>

    <update check="timeout" policy="always" />

    <resources>
    <java version="1.6*" href="http://java.sun.com/products/autodl/
    j2se"/>
    <jar href="lib/myAppSync.jar" />
    <jar href="lib/apache-mime4j-0.6.jar" />
    <jar href="lib/commons-logging-1.1.1.jar" />
    <jar href="lib/commons-codec-1.3.jar" />
    <jar href="lib/httpclient-4.0.1.jar" />
    <jar href="lib/httpcore-4.0.1.jar" />
    <jar href="lib/httpmime-4.0.1.jar" />
    <jar href="lib/swingx-1.6.jar" />
    <jar href="lib/swingx-beaninfo-1.6.jar" />
    </resources>

    <application-desc main-class="com.myapp.sync.forms.Main"/>

    </jnlp>


    error log:
    ==========
    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.<init>(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)

    or sometimes:

    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.<init>(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)
    Mathias Lin, Sep 14, 2010
    #1
    1. Advertising

  2. Mathias Lin

    Mathias Lin Guest

    I found that when I call 'javaws -offline myApp.jnlp' (with the -
    offline parameter!), webstart won't check online and throw an
    exception. But then it would also not check for updates IF I am
    actually connected to the internet.
    So with -offline, the offline mode works as I want it to, but it
    doesn't make much sense to me why it's necessary to add this param.
    Why does webstart not simply timeout when it cannot find the host in
    the regular mode?



    On Sep 14, 3:53 pm, Mathias Lin <> wrote:
    > I want to configure my webstart app/jnlp so that if no internet
    > connection is available, it would start from cache. *Nevertheless,
    > when I disconnect from the internet, I always get a
    > NoRouteToHostException or UnknownHostException exception, despite the
    > configuration below.*
    >
    > 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.
    >
    > jnlp file:
    > ==========
    >
    > <?xml version="1.0" encoding="UTF-8"?>
    > <jnlp spec="6.0+" codebase="http://cms.mydomain.com/sync/"
    > href="myAppSync.jnlp">
    >
    > <information>
    >     <title>My App Sync</title>
    >     <vendor>My Company</vendor>
    >     <homepage href="http://www.myapp.com/"/>
    >     <description>Sync application for My App</description>
    >     <icon href="ATTico.png"/>
    >
    >     <!-- allow app to run without Internet access -->
    >     <offline-allowed/>
    >
    >     <shortcut online="true">
    >       <desktop/>
    >       <!-- create menu item for this app under the major heading 'My
    > App' -->
    >       <menu submenu="My App"/>
    >     </shortcut>
    >
    > </information>
    >
    > <security>
    >     <all-permissions/>
    > </security>
    >
    > <update check="timeout" policy="always" />
    >
    > <resources>
    >     <java version="1.6*" href="http://java.sun.com/products/autodl/
    > j2se"/>
    >     <jar href="lib/myAppSync.jar" />
    >     <jar href="lib/apache-mime4j-0.6.jar" />
    >     <jar href="lib/commons-logging-1.1.1.jar" />
    >     <jar href="lib/commons-codec-1.3.jar" />
    >     <jar href="lib/httpclient-4.0.1.jar" />
    >     <jar href="lib/httpcore-4.0.1.jar" />
    >     <jar href="lib/httpmime-4.0.1.jar" />
    >     <jar href="lib/swingx-1.6.jar" />
    >     <jar href="lib/swingx-beaninfo-1.6.jar" />
    > </resources>
    >
    > <application-desc main-class="com.myapp.sync.forms.Main"/>
    >
    > </jnlp>
    >
    > error log:
    > ==========
    > 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(UnknownSource)
    > at sun.net.www.http.HttpClient.openServer(UnknownSource)
    > at sun.net.www.http.HttpClient.<init>(Unknown Source)
    > at sun.net.www.http.HttpClient.New(UnknownSource)
    > at sun.net.www.http.HttpClient.New(UnknownSource)
    > 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(UnknownSource)
    > 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)
    >
    > or sometimes:
    >
    > 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(UnknownSource)
    > at sun.net.www.http.HttpClient.openServer(UnknownSource)
    > at sun.net.www.http.HttpClient.<init>(Unknown Source)
    > at sun.net.www.http.HttpClient.New(UnknownSource)
    > at sun.net.www.http.HttpClient.New(UnknownSource)
    > 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(UnknownSource)
    > 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)
    Mathias Lin, Sep 15, 2010
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    432
    Cyril Mrazek
    Aug 6, 2003
  2. noone
    Replies:
    3
    Views:
    7,860
    noone
    Nov 11, 2003
  3. Dave Raskin
    Replies:
    0
    Views:
    400
    Dave Raskin
    Apr 26, 2004
  4. Replies:
    1
    Views:
    1,754
    Jan Peter Stotz
    Jun 8, 2005
  5. Roedy Green
    Replies:
    4
    Views:
    170
    Jeff Higgins
    Mar 25, 2014
Loading...

Share This Page