Project facet Dynamic Web Module version 3.0 is not supported.

In java projects, if the server is switched, the problem of dynamic web module version is often involved.

  
  For example: Create a new web project, start using the tomcat server, but then use the jboss server, it will appear: Project facet Dynamic Web Module version 3.0 is not supported.
   I wonder if you have noticed that when we create a new web project, the default dynamic version is 3.0, which can be confirmed as follows:
  
  This dynamic web module version is related to your servlet version. If you use tomcat7.0, it is generally 3.0; if tomcat6, it is generally 2.4 or 2.5.
  If the selection is different, the dtd files in the generated web.xml are also different, such as:
  1.   <?xmlversion="1.0"encoding"UTF-8"?>    
  2. <web-appxmlns: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:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"id"WebApp_ID"version ="3.0">        
  3. </web-app>  
  or   
  1. <?xmlversion="1.0"encoding"UTF-8"?>    
  2. <web-appxmlns: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:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"id"WebApp_ID"version ="2.5">        
  3. </web-app>  
 If you change to jboss server at this time and use jboss5.0 at this time, the following situation will occur:
 
 
  There is another situation: for example, when creating a new EJB project, for example, after filling in the name, it is directly defaulted. This is a consistent style (I believe most of them will be like this (*^__^*)) as shown below:
  
  By default, if you do not select the jboss version, the default is 3.1, but jboss 5.0 supports up to 3.0.
  Add the newly created ejb project in jboss5.0, as shown below:
  
  
  What should I do if the above situation occurs? Rebuild? If the new one has not been operated, it may be worthwhile, but if the code is written, what should I do?
  When you have a problem, turn to the Internet for help, hee hee.
  The plan is as follows:
  Find the hard disk directory of the project and open the .setting folder under the project, as shown below:
  
   
Find the org.eclipse.wst.common.project.facet.core.xml file   in the .setting folder. The file format is roughly as follows:
  1. <?xmlversion="1.0"encoding="UTF-8"?>    
  2. <faceted-project>  
  3.   <runtimename="Apache Tomcat v7.0"/>   
  4.   <fixed facet="java"/>  
  5.   <fixed facet="jst.web"/>  
  6.   <fixed facet="wst.jsdt.web"/>  
  7.   <installed facet="java" version="1.7"/>  
  8.   <installed facet="jst.web" version="3.0"/>  
  9.   <installed facet="wst.jsdt.web" version="1.0"/>  
  10. </faceted-project>  
  
  Just manually modify the version corresponding to jst.web. Finally, restart tomcatX and it can be used normally.

  Then refresh the project.
  If you change the attribute in eclispe, it cannot be changed, as follows:
  
 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326605899&siteId=291194637