The following required field is missing from the launch file: JNLP

This error has been giving me a few problems in the last past days with some JNLP files that should have opened up a web application so I thought that maybe writing about it will help some of you too. I have to confess that I found the solution without any real research and it was just a lucky guess.

First let’s see how the error actually looks like and what are the common steps before it occurs.

You should know that a JNLP file is an XML document, so some people refer to it as a JNLP file while others refer to it as a XML file but in the end, at least for the purpose of this article they are the same: the JNLP file written in XML code. The first lines usually found inside such files are the ones below:

<?xml version=”1.0″ encoding=”utf-8″?>
<!– JNLP Comment for some application here – this is optional –>
<jnlp
spec=”1.5+”
codebase=Http://compinfopro.com

  href="example.jnlp">
.
.
</jnlp>

Probably you have a file with a JNLP extension that you usually run in order to get the Java WebStart application running through the use of Java Network Launching Protocol (most of the times this actually means you will double click the XML file and it will open up an application through the use of an embedded website link or intranet link from inside the XML file). You can imagine that the process behind this simple action is a little bit complicated and there are times when it can fail. One of these times is the one you are probably having right now if you reached us by searching above error.

This means something went wrong during the process and you got an error similar or close to the one in the image saying “Unable to launch the application”, and if you click on Details, it gets even better:

The Following Required Field Is Missing From the Launch File: JNLP

The Following Required Field Is Missing From the Launch File: JNLP - Details

Don’t waste your time checking event viewer or any other logs regarding this matter, there won’t be any and the logs provided by Java won’t help you much either. You will find exactly the same thing as you can see in the details. I lost about 1 hour for this before I could move on and try to fix it without any real clue and the only thing close to a report or log file will be the details from the error as you can see below:

General

The following required field is missing from the launch file:

……………………………………………..

Exception

MissingFieldException[ The following required field is missing from the launch file: <jnlp> ]

at com.sun.javaws.jnl.xml.XMLFormat.parse(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)

at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)

at com.sun.javaws.Main.launchApp(Unknown Source)

Of what I have seen, this can be caused by at least three things (most common problems) and I will try to cover them all. However, you should know that the first solution managed somehow to fix the problem for multiple cases, even if against all odds the error message would point to the last solution provided by me. The first solution, to install the latest Java version did something transparent for me that I didn’t manage to figure it out yet that amazingly fixed the problem. The funny thing is that the error is actually saying that the JNLP file is broken due to a missing <jnlp> XML tag as an interpreter to start the language code, like you would have <html> for html language or <?php> for PHP, or we can go even further to say that the first JNLP tag is incomplete, or missing some instruction from the XML code.

I can’t imagine what could cause such failures for the JNLP file but there are times when you will download it to your computer and you will notice it is not working and you are getting the error. First, try to get a new copy of the XML/JNLP file from whatever source you got it in the first place. Alternatively, you can get the file by accessing the link inside the XML file, which can be found directly by checking the print screens at “First Solution” or just by opening the broken file and searching for this line if it does exist and it is not corrupted:

<jnlp spec=”1.0+” codebase=”http:// compinfopro.com” href=”testfile.jnlp”>

Add the codebase content to href file name with a slash to split them and you got yourself an URL to download the XML file, for example:

http:// compinfopro.com/testfile.jnlp

If this fails and you get the same error then continue to try it with another Web Browser because something happens during the download process and the file gets damaged and broken. If it doesn’t work with another Web Browser but it works on other computers, your computer has a problem. You will have to dig more into it or try a system restore if this process worked at any given time before.

Solution 1

This is your best hope for a quick fix, and yes, if you will ask a programmer or a person responsible for tool support (bigger companies), they will strongly tell you not to do it because it is not supported by its application and some other similar crap but the truth in most cases is that they didn’t even bother to test their software with other Java versions due to commodity. If this is not possible for you, try the last solution provided, as the second one is related to this one.

If you are interested in doing this and it is possible for you, download the latest java stable version, remove your current, install the newly downloaded one and test the web application again by running the file to see if the application opens.

Java supports its older capabilities while getting new ones, as for the risk, do it only if you don’t have any other sensitive applications running on java.

I will make it even simpler for you; you can check if the location of the actual JNLP file that you can find in the XML file, used to load the JNLP file content is correct. The path from it can be found if you follow above steps for accessing the link inside the XML file or below steps for a better understanding.

Navigate to Start – control panel – double click the Java Icon. In order to continue you have to click on the “View” – under “Temporary Internet Files”:

The Following Required Field Is Missing From the Launch File: JNLP - Java Control Panel

This will bring up a list of WebStart Applications installed on your computer. You will have to right click the application you are trying to open and select from the pick list “Show JNLP File”.

The Following Required Field Is Missing From the Launch File: JNLP

You will see a lot of details in the source file but not in my print screen due to security, but you only need to search one thing, usually located in the first line.

I have enclosed with red lines the part that you should look for, the actual link that opens up and points to the Web Application URL and that you should copy/paste to your Web Browser.

The Following Required Field Is Missing From the Launch File: JNLP

Note: I will mention again that according to the error message this first line with “<jnlp>” tag(spec, codebase and href are properties for it) doesn’t exist or has a problem so check the syntax too for any lacks or closing tags or wrong attributes.

The Following Required Field Is Missing From the Launch File: JNLP

As soon as you copy the entire link (for example href=”http://test.com/example.jnlp“> – you should copy the bolded part) to your web browser, you can see that it works if launched directly with the correct path to it.

Somewhere along the way it seems that JNLP fails to parse the code properly and the above error comes into place. This mostly happens with older Java versions, so my advice to you is to get a newer version and install it. You will see that as soon as you have it, you can run the file as before and it will successfully open your Web Application.

Mostly of what I have seen, this happens with Java version 1.6 and earlier, if you have 1.7.x chances are that the Java version is not the problem. To check what Java version you have go to Start – Run – open a command prompt window and type “java -version”. It should return the Java version you currently have installed.

The Following Required Field Is Missing From the Launch File: JNLP - Java version

Note: You will find the installation package for download with the version and the update package under different names on websites. For example what you can see on the above print screen would be found on the Internet as Java 7 Update 4 and as installer jre-7u4-windows-i586.exe. Note the 7 after 1. and then 4 as update after 1.7.0_ which is actually 04.

Solution 2

This comes more as additional instructions to Solution 1 in case it didn’t fix your problem. There were times when the first solution didn’t work due to some hidden leftovers or cache, but sometimes it can be caused by security measures too.

What I am talking about in here is the fact that you should delete the “Temporary Internet Files” for Java. To do this, navigate to Start – Control Panel and find Java Control Center. Open it and select “Settings” from “Temporary Internet Files” as you can see below:

The Following Required Field Is Missing From the Launch File: JNLP - Java Control Panel

Now select “Delete Files”.

The Following Required Field Is Missing From the Launch File: JNLP

Use default settings to delete Java cache and press OK.

The Following Required Field Is Missing From the Launch File: JNLP

When this is done, you should also make sure your Web Browser is not blocking any popups for the WebStart Application and that the security level is not at maximum. In Internet explorer you can find these settings at Tools – Internet Options – Privacy Tab. If by any reason you enabled the popup blocker and you can’t disable it for a short while for testing, add the WebStart Application to exceptions (Allow List – in the same screen if you click “Settings” for “Popup Blocker Section”).

The Following Required Field Is Missing From the Launch File: JNLP - Internet Options

Firewall and certain antivirus software can also cause this error, but you can easily test it by disabling them for a short while until you see if it works or not. If this is the problem find a way to add the WebStart Application to exceptions.

Solution 3

This is one of the solutions that you will probably hate the most as it implies more research and possible even asking for help and waiting for feedback. In here, and assuming that none of the previous solutions worked, we will have to treat each case individually as there might be custom parameters missing from the equation that we ignored or you didn’t think they count. These are the cases when the code in the XML file is either corrupted or faulty due to the download process or some other unknown reason which in some cases can be some third party software that tampered with it. I trust that by now, as instructed in the first steps, you checked manually for broken code, broken link to follow and corrected JNLP location manually.

I should also cover in here that for those of you running local web servers on your own computers for testing and software development there can be a lot of cases when the permissions to the JNLP file are not correct or they are nonexistent or certain similar problems caused by lack of attention or the desire of people to push the problem somewhere else, when they should first double check their environment.

So, to go on with the last possible solution, you will have to stare at the code and analyze it for bad syntax or errors. To edit the XML config file for the JNLP to work correctly and check for syntax problems, you will have to use NETBeans IDE or jEdit. You can find on the following link another possible cause for The Following Required Field Is Missing From the Launch File: JNLP problem that says there were some illegal embedded code tags: http://docs.oracle.com/javase/tutorial/deployment/webstart/problems.html

You should also have a look in here for a paragraph that says that the jnlp_href attribute should specify the JNLP file to be used: http://docs.oracle.com/javase/tutorial/deployment/applet/html.html

For any other issue or cases you encounter that don’t match to any of my possible solutions, do describe your situation and we can try to find out together.

VN:F [1.9.22_1171]
Rating: 5.0/5 (2 votes cast)
The following required field is missing from the launch file: JNLP, 5.0 out of 5 based on 2 ratings

Author: bitpsychobyte

Share This Post On

We would be glad to receive any feedback from you. Throw it at us, we can handle it!