edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

Fails to launch without an internet connection #7

Closed voddan closed 8 years ago

voddan commented 8 years ago

Steps to reproduce: 1) Download a launcher 2) Launch for the first time - the app is downloaded and launched 3) Exit the app, turn your Internet off 4) Try to launch the app again - exception, part of the content is not loaded

I used the example app https://github.com/edvin/fxlauncher#try-a-native-installer

Stack trace: java.net.UnknownHostException: fxsamples.tornado.no at java.net.InetAddress.getAllByName0(InetAddress.java:1280) at java.net.InetAddress.getAllByName(InetAddress.java:1192) at java.net.InetAddress.getAllByName(InetAddress.java:1126) at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:111) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71) at tornadofx.Rest.execute(Rest.kt:142) at tornadofx.Rest.execute$default(Rest.kt:128) at tornadofx.Rest.get(Rest.kt:96) at tornadofx.Rest.get$default(Rest.kt:96) at controller.ContactController.listContacts(ContactController.kt:13) at view.ContactList$1.invoke(ContactList.kt:23) at view.ContactList$1.invoke(ContactList.kt:13) at tornadofx.Component$background$1.call(Component.kt:53) at javafx.concurrent.Task$TaskCallable.call(Task.java:1423) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.lang.Thread.run(Thread.java:745)

edvin commented 8 years ago

Hi! FXLauncher handles the lack of internet connection gracefully, but the demo application needs an internet connection to function. In other words, this is not a bug in FXLauncher, but merely due to lack of application code to verify that an internet connection is present :)

You can verify it with this demo application: http://fxldemo.tornado.no/ (which doesn't have any network reliant code).

I do agree that the demo application might handle the lack of internet connection more gracefully Does that make sense?

voddan commented 8 years ago

Yes it does, thank you!

I was mistaken by the exception, sorry. Maybe a dialog instead of the exception would look better for the app

voddan commented 8 years ago

The issue is resolved

edvin commented 8 years ago

Absolutely, I'll add some code to check for a connection at startup :)