karakun / OpenWebStart

Run Web Start based applications after the release of Java 11
https://openwebstart.com
Other
419 stars 48 forks source link

Could not read or parse the JNLP file | NullPointerException #450

Closed Satish-GV closed 3 years ago

Satish-GV commented 3 years ago

Hi Team, We're using OpenWebStart in one of our application. And, it is being accessed in a HTTPS enabled application. We're executing the JNLP file from a JavaScript file as below,

document.location = 'jnlp://<domain>:<port>/test/sample.jnlp';

Karakun flash screen is seen and there's a prompt to open the JNLP file using OpenWebStart too. But, OWS is throwing below errors,

Debug is as below,

[ITW-CORE][2021-09-06 16:37:56.766 IST][DEBUG][net.adoptopenjdk.icedteaweb.http.HttpUtils] Following exception should be harmless, but may help in finding root cause. java.net.SocketException: Unexpected end of file from server at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:851) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:848) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)

Errors is as below,

netx: Read Error: Could not read or parse the JNLP file at 'http://<domain>:<port>/test/sample.jnlp'. (java.lang.NullPointerException ())

net.sourceforge.jnlp.LaunchException: Fatal: Read Error: Could not read or parse the JNLP file at 'http://:/test/sample.jnlp'. You can try to download this file manually and send it as bug report to IcedTea-Web team. at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:331) at net.sourceforge.jnlp.Launcher.launch(Launcher.java:191) at net.sourceforge.jnlp.runtime.Boot.launch(Boot.java:355) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:335) at net.sourceforge.jnlp.runtime.Boot.run(Boot.java:73) at java.security.AccessController.doPrivileged(Native Method) at net.sourceforge.jnlp.runtime.Boot.runMain(Boot.java:279) at net.sourceforge.jnlp.runtime.Boot.mainWithReturnCode(Boot.java:132) at net.sourceforge.jnlp.runtime.Boot.main(Boot.java:114) at com.openwebstart.launcher.PhaseTwoWebStartLauncher.main(PhaseTwoWebStartLauncher.java:81) at com.openwebstart.launcher.OpenWebStartLauncher.main(OpenWebStartLauncher.java:35) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84) at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94) at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25) Caused by: java.io.IOException: java.lang.NullPointerException at net.sourceforge.jnlp.JNLPFileFactory.openURL(JNLPFileFactory.java:107) at net.sourceforge.jnlp.JNLPFileFactory.create(JNLPFileFactory.java:79) at net.sourceforge.jnlp.JNLPFileFactory.create(JNLPFileFactory.java:63) at net.sourceforge.jnlp.Launcher.fromUrl(Launcher.java:299) ... 17 more Caused by: java.lang.NullPointerException at java.io.FileInputStream.(FileInputStream.java:130) at net.sourceforge.jnlp.JNLPFileFactory.openURL(JNLPFileFactory.java:103) ... 20 more

JNLP file content is as below,

<?xml version="1.0" encoding="UTF-8"?> <jnlp href="sample.jnlp" spec="1.0+" codebase="jnlp://<domain>:<port>/test">
Print Hello Print Feature Data to be printed Courier 10

FelixJongleur42 commented 3 years ago

Related to #226 ?

Satish-GV commented 3 years ago

In #226 , I see below solutions being suggested,

  1. fix codebase value in the jnlp file (server-side)

    • What exactly is this fix? In the JNLP file, tried below ways, but, still same issue, <jnlp href="sample.jnlp" spec="1.0+" codebase="jnlp://<domain>:<port>/test"> <jnlp href="sample.jnlp" spec="1.0+" codebase="https://&lt;domain&gt;:&lt;port&gt;/test">
  2. fix proxy settings

    • There's no proxy involved.
  3. delete icedtea-web Cache

    • I tried, but issue still exists.

    I suspect, issue is due to OWS trying to access the JNLP file using http and not https. In the OWS logs I see this error - "Could not read or parse the JNLP file at 'http://:/test/sample.jnlp' " Mine is a https application, how to ensure OWS also uses https and not http.

    If it's not due to http, what could be the reason for the issue ?

janakmulani commented 3 years ago

Can you please send us the logs?

Satish-GV commented 3 years ago

logs.zip

Attached OWS logs and the JNLP file being used. In the logs, I've replaced actual domain with <domain> , port with <portnum> and user_name with <UserID>

Note that I'm launching JNLP from a javascript as below,

document.location = 'jnlp://<domain>:<port>/test/sample.jnlp';

FelixJongleur42 commented 3 years ago

Just as a wild guess, and to narrow it down, have you tried jnlps://

Satish-GV commented 3 years ago

Thank You.

Issue is resolved after launching the JNLP using jnlps://.

document.location = 'jnlps://<domain>:<port>/test/sample.jnlp';

Even in the logs I now see https:// while accessing JNLP file.