edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
715 stars 107 forks source link

Exception when launched with --uri while Internet is disconnected #129

Open varunsingh001 opened 6 years ago

varunsingh001 commented 6 years ago

Application should be launched without network access and the exception should not suppress launching application. Instead received below :

java.lang.IllegalArgumentException: Unable to retrieve embedded or remote manifest. at fxlauncher.AbstractLauncher.createApplicationEnvironment(AbstractLauncher.java:162) at fxlauncher.Launcher.lambda$start$0(Launcher.java:149) at java.lang.Thread.run(Thread.java:748)

Is it possible to configure somehow launching application without seeing exception with uri passed at runtime ?

stopOnUpdateErrors is not overriden

edvin commented 6 years ago

The error message suggests that there was no manifest embedded in the launcher, so where would it get the manifest from in this case? :)

varunsingh001 commented 6 years ago

I believe it is embed, the issue arrives after I successfully update the app using --uri and then go offline and try to launch again.

below should embed the XML `

embed-manifest-in-launcher
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>jar</executable>
                        <workingDirectory>${app.dir}</workingDirectory>
                        <arguments>
                            <argument>uf</argument>
                            <argument>fxlauncher.jar</argument>
                            <argument>app.xml</argument>
                        </arguments>
                    </configuration>
                </execution>`

Also I can manually check XML inside jar

varunsingh001 commented 6 years ago

It looks like launcher tries to resolve params like --app/--uri to load manifest but if it returns with an exception it wont fallback to the app.xml in cache dir or one embedded in jar, hence instance of manifest is null and throws IllegalArgumentException. Is my understanding correct ?

edvin commented 6 years ago

That sounds about right. Would you like to submit a PR to fix it perhaps? :)