Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Webstart not working offline (NoRouteToHostException/UnknownHostException)

Reply
Thread Tools

Java Webstart not working offline (NoRouteToHostException/UnknownHostException)

 
 
Mathias Lin
Guest
Posts: n/a
 
      09-14-2010
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.http://www.protocol.http.HttpURLConn...Client(Unknown
Source)
at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown
Source)
at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)
at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
Source)
at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unkn own Source)
at com.sun.javaws.LaunchDownload.downloadJarFiles(Unk nown Source)
at com.sun.javaws.LaunchDownload.downloadEagerorAll(U nknown 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.http://www.protocol.http.HttpURLConn...Client(Unknown
Source)
at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown
Source)
at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown Source)
at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)
at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)
at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
Source)
at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
Source)
at com.sun.deploy.net.DownloadEngine.getResource(Unkn own Source)
at com.sun.javaws.LaunchDownload.downloadJarFiles(Unk nown Source)
at com.sun.javaws.LaunchDownload.downloadEagerorAll(U nknown 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)
 
Reply With Quote
 
 
 
 
Mathias Lin
Guest
Posts: n/a
 
      09-15-2010
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 <(E-Mail Removed)> 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.http://www.protocol.http.HttpURLConn...Client(Unknown
> Source)
> at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown
> Source)
> at sun.net.http://www.protocol.http.HttpURLConn...(UnknownSource)
> at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)
> at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)
> at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
> at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
> at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
> Source)
> at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
> Source)
> at com.sun.deploy.net.DownloadEngine.getResource(Unkn own Source)
> at com.sun.javaws.LaunchDownload.downloadJarFiles(Unk nown Source)
> at com.sun.javaws.LaunchDownload.downloadEagerorAll(U nknown 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.http://www.protocol.http.HttpURLConn...Client(Unknown
> Source)
> at sun.net.http://www.protocol.http.HttpURLConn...onnect(Unknown
> Source)
> at sun.net.http://www.protocol.http.HttpURLConn...(UnknownSource)
> at com.sun.deploy.net.BasicHttpRequest.doRequest(Unkn own Source)
> at com.sun.deploy.net.BasicHttpRequest.doGetRequestEX (Unknown Source)
> at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
> at com.sun.deploy.net.DownloadEngine.isUpdateAvailabl e(Unknown Source)
> at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
> Source)
> at com.sun.deploy.net.DownloadEngine.getResourceCache Entry(Unknown
> Source)
> at com.sun.deploy.net.DownloadEngine.getResource(Unkn own Source)
> at com.sun.javaws.LaunchDownload.downloadJarFiles(Unk nown Source)
> at com.sun.javaws.LaunchDownload.downloadEagerorAll(U nknown 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)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sun/Java would win BIG if they included xml based RIA in Java WebStart (think Adobe Flex) kwiatekfamily@gmail.com Java 2 03-08-2008 06:47 AM
Java WebStart parameters Matthew Zimmer Java 0 11-06-2003 04:39 PM
Java Webstart and JNI Henri Java 4 09-22-2003 07:08 PM
Java WebStart yuen Java 1 09-07-2003 02:06 PM
webstart and java.util.Preferences ? Carsten Zerbst Java 1 07-16-2003 03:02 PM



Advertisments