JNLP Extension does not open in Internet Explorer
Asked Answered
D

3

6

I am having an issue of opening *.jnlp extensions using Internet Explorer. The extension opens properly in Chrome and Firefox, leading me to believe it is an issue with IE and possibly the web server/JNLP configuration. Specifically, internet explorer opens the *.jnlp file as an *.xml script instead of downloading the file or opening it with java web start.

Example:

<?xml version="1.0" encoding="utf-8" ?>
- <!--
 JNLP File for Downtime Registration Application
  -->
- <jnlp spec="1.7+" codebase="http://foo:8080/bar" href="bar.jnlp">
- <information>
  <title>FOO</title>
  <vendor>FOO Inc.</vendor>
  <description>FOO BAR System</description>
- <shortcut online="false">
  <desktop />
  <menu submenu="FOO" />
  </shortcut>
  </information>
- <security>
  <all-permissions />
  </security>
- <resources>
  <j2se version="1.7+" java-vm-args="-client" />

  ... 

  </resources>
  <application-desc main-class="FooBarMainApp" />
  </jnlp>

I have tried the following "Fixes"/workarounds to no avail:

  • Run IE as Administrator
  • Adding URL to compatibility view
  • Changing JAVA settings to "Always allow JNLP/MIME"
  • Reset internet explorer advanced settings
  • Change the MIME extension settings in the web.xml file of the web server
  • Change IE setting to always allow file downloads

Update: I was able to fix this issue with the workaround I posted below. However, I am looking for a more permanent fix if anyone has suggestions. Specifically, I am looking for a way to fix this on the business/server side if at all possible. It would be nice if the users didn't need to change any settings on their side (other then switching from IE to a different browser).

MIME-Mapping in web.xml:

  <mime-mapping>
    <extension>jnlp</extension>
    <mime-type>application/x-java-jnlp-file</mime-type>
</mime-mapping>
Desta answered 12/5, 2015 at 16:7 Comment(6)
:Change the MIME extension settings in the web.xml file of the web server" That is all that should be required. What did you set it to? BTW - 1) Be sure to check the JNLP using JaNeLA, available at my share drive. 2) What browsers launch the JNLP successfully?Poultice
Chrome and Firefox launch the JNLP with no issues. It is just Internet Explorer that is having the problem. I added the code used for the MIME mapping in the question as an edit.Desta
And.. did JaNeLA have anything to report about the MIME/content type?Poultice
I see what should be an issue, but I am not sure how to resolve it. There is a line Content type application/xml does not equal expected type of application/x-java-jnlp-file. If this statement is true, it would most definitely be the culprit. I found something online, but I have yet to try it out: <%@ page contentType="application/x-java-jnlp-file" %>. Will let you know if it fixes the issue. Thanks Andrew.Desta
Okay.. so adding <%@ page contentType="application/x-java-jnlp-file" %> to the very beginning of the JNLP fixes the particular issue I was facing, but adds a new one (typical ;)). WS now starts automatically and runs the JNLP but gives an error "Could not parse launch file. Error at line 1" (the line added in). Specifically WARNING: <> tag is not closed correctly . Will give an update after I play around. I see there is an '@' present at the beginning but not the end..Desta
@Andrew Thompson I Can't seem to get a configuration of contentType that will work. Which is weird seeing as I got that line of code from oracle documentation..I am not proficient in XML enough to look at it and guess what the proper syntax should be. Handy little program you made there though.Desta
D
9

I ended up fixing this problem by changing a specific setting within Internet Explorer.

Tools -> Internet Options -> Security -> Custom Level... -> Miscellaneous -> Enable MIME Sniffing- > Disable

It took me a while to find this fix, so I'm including it here in case anyone else has this issue as well.

PS: This is more of a workaround then a permanent fix. Any additional insight would be helpful.

Update: Ended up adding <%@ page contentType="application/x-java-jnlp-file" %> to the beginning of the JNLP file and then building the war. Essentially the JNLP would automatically launch but give a parsing error. Once this line was then taken out of the JNLP and the WAR was re-built, the JNLP would launch javawebstart and the parsing error was gone (AKA Problem Solved). Don't really know why, but this magic seemed to work.

Desta answered 12/5, 2015 at 16:7 Comment(1)
I forgot to add that if anyone still has any ideas I would appreciate them.Desta
D
0

I store my JWS application out of the EAR/WAR, along with all signed libraries.

If the JWS application is hosted in an Apache web server, in httpd.conf, you can add the type as follows:

AddType application/x-java-jnlp-file .jnlp

Reference here: http://httpd.apache.org/docs/current/mod/mod_mime.html

Donohue answered 16/9, 2016 at 17:36 Comment(0)
S
0

JNLP issue could be fixed by following the steps below:

  1. Open Mozilla Firefox and then download the JNLP extention. Mozilla Asked me how to open it, I chose Open with javaws (on C:\Program Files\Java\jre1.8.0_161\lib).
  2. Choose apply this choice from now on.

I tried to open it on Internet explorer and it worked automatically.

Or from Dowloaded file click right on JNLP extention file, open with javaws (on C:\Program Files\Java\jre1.8.0_161\lib). I did not try this one but i think it should work.

Swordfish answered 18/2, 2018 at 9:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.