0

I built the project using maven

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>org.example</groupId>
<artifactId>lab3</artifactId>
<version>1.0-SNAPSHOT</version>

<packaging>war</packaging>

<dependencies>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>1.2-20</version>
    </dependency>
    <dependency>
        <groupId>javax.faces</groupId>
        <artifactId>javax.faces-war-archetype</artifactId>
        <version>2.2</version>
    </dependency>
    <dependency>
        <groupId>jakarta.platform</groupId>
        <artifactId>jakarta.jakartaee-api</artifactId>
        <version>9.1.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <finalName>lab3</finalName>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>3.3.1</version>
            <configuration>
                <webXml>src\main\webapp\WEB-INF\web.xml</webXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
        </plugin>
    </plugins>
</build>

<properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
</properties>

I'm trying to start the server using wildfly.Catching the following error

13:16:20,965 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) WFLYSRV0028: Stopped deployment lab3.war (runtime-name: lab3.war) in 14ms
[2022-10-12 01:16:20,998] Artifact lab3.war: Error during artifact deployment. See server log for details.
[2022-10-12 01:16:20,998] Artifact lab3.war: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"lab3.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
    Caused by: java.lang.NoClassDefFoundError: Failed to link javax/faces/webapp/FacesServlet (Module \"deployment.lab3.war\" from Service Module Loader): javax/servlet/Servlet"}} 

I have already assembled my own project, and tried to launch others' ready-made ones. Everything doesn't work.

also that web.the xml that is generated in target works strangely web.xml

skver
  • 3
  • 3

1 Answers1

0

intellij idea incorrectly makes imorts. In maven, you need to change javax.faces on jakarta

skver
  • 3
  • 3