1

Eu tive esse problema e achei que tivesse solucionado, porem quando abri o eclipse hj o problema simplesmente voltou a acontecer, o estranho é que o mesmo só ocorre dentro da IDE, pois se eu compilar e colocar o war no wildfly o mesmo executa sem problemas.

O problema fica ainda mais estranho devido ao fato que quando entro em "projeto -> propriedades -> project facets" o "Dynamic Web Module" está definido como 4.0

segue o arquivo de configuração do projeto que tem tal informação, chamado "org.eclipse.wst.common.project.facet.core.xml":

<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
  <fixed facet="wst.jsdt.web"/>
  <installed facet="wst.jsdt.web" version="1.0"/>
  <installed facet="java" version="1.8"/>
  <installed facet="jst.web" version="4.0"/>
  <installed facet="jst.jsf" version="2.2"/>
  <installed facet="jst.jaxrs" version="2.0"/>
</faceted-project>

meu pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>br.com.lsoft</groupId>
  <artifactId>gamesapi</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>gamesapi Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>4.0.0</version>
        <scope>provided</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/javax.servlet.jsp/javax.servlet.jsp-api -->
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>javax.servlet.jsp-api</artifactId>
        <version>2.3.1</version>
        <scope>provided</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/org.wildfly/wildfly-servlet-feature-pack -->
    <!-- https://mvnrepository.com/artifact/org.wildfly/wildfly-spec-api -->
    <dependency>
        <groupId>org.wildfly</groupId>
        <artifactId>wildfly-spec-api</artifactId>
        <version>13.0.0.Final</version>
        <type>pom</type>
    </dependency>




  </dependencies>
  <build>
    <finalName>gamesapi</finalName>

    <plugins>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
              <source>1.8</source>
              <target>1.8</target>
            </configuration>
        </plugin>

    </plugins>

  </build>
</project>

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" 
    id="WebApp_ID" 
    version="4.0">


  <display-name>Archetype Created Web Application</display-name>


  <welcome-file-list>
    <welcome-file>index.html</welcome-file>
    <welcome-file>index.htm</welcome-file>
    <welcome-file>index.jsp</welcome-file>
    <welcome-file>default.html</welcome-file>
    <welcome-file>default.htm</welcome-file>
    <welcome-file>default.jsp</welcome-file>
  </welcome-file-list>
</web-app>

ja tentei baixar o eclipse novamente, pensando que talvez a versão que eu tinha pego estava com problema, porem não adiantou

não faço ideia do que pode estar acontecendo, alguém sabe me dizer o que poderia estar causando isso????

IDE: eclipse projeto: maven(maven-archetype-webapp)

segue o link do post que criei anteriormente:

https://cursos.alura.com.br/forum/topico-como-fazer-o-build-e-executar-pela-ide-79891

1 Resposta 1

1

Altere no arquivo org.eclipse.wst.common.project.facet.core.xml a facet jst.web para 3.0 ou desejada:

<installed facet="jst.web" version="3.0"/>

Altere também seu web.xml as informações do deployment descriptor (o atributo version e o schemaLocation) para refletir a versão desejada:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"      version="3.0">

Você pode encontrar aqui(artigo em inglês) mais deployment descriptors.

Você deve fazer log-in para responder a esta pergunta.

Esta não é a resposta que você está procurando? Pesquise outras perguntas com a tag .