Description on the Error Message : Web application version is unsupported
In this article, the main subject for further description is about how to solve a certain error. It is an error with the message of “Web application version is unsupported”. The error message appears in a Java IDE. The following is the image of the error message :
The above error message happens after a new XML file was created. The file name is ‘web.xml’. This file has a specific purpose and it acts as a Java Web Application deployment descriptor. After creating the file, whenever a new Java or Servlet is going to be created, the window dialog will appear with the error message.
How to Solve the Error Message
Apparently, the solution for solving the problem is actually simple. First of all, the hint for solving the problem or the error message is already clear. The problem relies on the “Web application version”. The following are steps taken for solving the problem :
1. Check the Web Application Deployment Descriptor file. Normally, the file exist in the WEB-INF of the Java application folder. The file name is ‘web.xml’. The following is the content of the file :
<!--?xml version="1.0" encoding="UTF-8"?--> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <root> </root>
2. The above file’s content is normally a default content of a new XML file created in NetBeans IDE. The process for creating the XML file is done using NetBeans IDE. By executing the right-click on the project folder and then click the New > XML Document menu, a new XML file will be created. Below is the image of the right-click menu :
Since the content of the original XML file is false, change it accordingly. In order to deploy the Java Web Application properly, the following content is the correct one :
<?xml version="1.0" encoding="UTF-8"?> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaid="WebApp_ID" version="2.5"> <!-- The rest of your web.xml content --> </web-app>
- After editing the XML file named ‘web.xml’, don’t forget to save the file. After saving the file, try to create a new Java file or a new Servlet again. The error message will disappear.