JNLP Extension does not open in Internet Explorer

ballBreaker picture ballBreaker · May 12, 2015 · Viewed 39.3k times · Source

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>

Answer

ballBreaker picture ballBreaker · May 12, 2015

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.