Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Satish-GV opened this issue Sep 6, 2021 · 6 comments
Closed

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

Satish-GV opened this issue Sep 6, 2021 · 6 comments

Comments

@Satish-GV
Copy link

Satish-GV commented Sep 6, 2021

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">
<title>Print</title> Hello Print Feature Data to be printed Courier 10
@FelixJongleur42
Copy link

Related to #226 ?

@Satish-GV
Copy link
Author

Satish-GV commented Sep 7, 2021

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://<domain>:<port>/test">
  1. fix proxy settings
  • There's no proxy involved.
  1. 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
Copy link
Contributor

Can you please send us the logs?

@Satish-GV
Copy link
Author

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
Copy link

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

@Satish-GV
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants