Java Webstart not working offline (NoRouteToHostException / UnknownHostException)

I want to configure the webstart / jnlp application so that if an internet connection is not available, it will start with a cache. However, when I disconnect from the Internet, I always get a NoRouteToHostException or UnknownHostException, despite the configuration below.

I correctly set up tags / attributes that were offline and updated tags / attributes; I cannot find the reason webstart is still trying to find the host. I definitely have an application cached from my previous start when I was connected.

<?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) 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) 
+6
java java-web-start jnlp
source share
2 answers

I found a solution by calling javaws from the command line with the -offline parameter, but I find it strange that it is necessary, wondering why the system cannot automatically detect that I am offline and therefore the timeout on the check and run the application from the cache as defined in my jnlp.

 javaws -offline myApp.jnlp 
+2
source share

This can be achieved with <update check="background"/> , but updates will no longer be downloaded immediately when they are available, this requires a second run, which is annoying.

It really looks like a Java Web Start error, <update check="timeout"/> should not prevent the application from starting if the connection time to the server does not work.

0
source share

All Articles