3

I have a problem trying to deploy a Spring app in wildfly. the error is apparently related to Weld but I'm not sure why it uses Weld and not spring dependency injection.

this is the error that the console shows:

ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "name.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"name.war\".component.\"javax.servlet.http.HttpServlet$NoBodyAsyncContextListener\".WeldInstantiator" => "Failed to start service
    Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class javax.servlet.http.HttpServlet$NoBodyAsyncContextListener
    Caused by: java.lang.IncompatibleClassChangeError: javax.servlet.http.HttpServlet and javax.servlet.http.HttpServlet$NoBodyAsyncContextListener disagree on InnerClasses attribute"}}

as general information:

  • The project is a Spring application "but not spring boot".
  • Project is using Wildfly 24 and the Spring version is 5.3.8.
  • the app works perfectly in tomcat.

I have disabled Weld from the profiles, in the wildfly standalone.xml file but after I disable it the server cannot start. finally, I have seen forums but I have not found any information that can help me. so any information will be highly valued.

Here are the dependencies from my pom.

<dependencies>
        <dependency>
            <groupId>commons-fileupload</groupId>
            <artifactId>commons-fileupload</artifactId>
            <version>1.4</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>${myfaces.version}</version>
        </dependency>

        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>${myfaces.version}</version>
        </dependency>

        <dependency>
            <groupId>javax.enterprise</groupId>
            <artifactId>cdi-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.taglibs</groupId>
            <artifactId>taglibs-standard-spec</artifactId>
            <version>1.2.5</version>
        </dependency>

        <dependency>
            <groupId>javax.activation</groupId>
            <artifactId>activation</artifactId>
            <version>1.1.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.primefaces</groupId>
            <artifactId>primefaces</artifactId>
            <version>${primefaces.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
            <version>${spring-boot.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>

        <dependency>
            <groupId>org.reactivestreams</groupId>
            <artifactId>reactive-streams</artifactId>
            <version>1.0.3</version>
        </dependency>

</dependencies>
  • Did you accidentally include a `servlet-api` jar in your list of dependencies? – M. Deinum Aug 02 '21 at 09:18
  • not really. The only dependencies where I have * -api as a prefix are: ``` org.apache.myfaces.core myfaces-api and javax.enterprise cdi-api ``` – Kevin Santiago Rey Aug 02 '21 at 10:32
  • Please don't add additional information as comments, instead edit your question. The artificat doesn't have to end with API, if there is something including those classes that can lead to issues. So please include your `pom.xml` to your question. – M. Deinum Aug 02 '21 at 11:31
  • I did not know. sorry. I have copied the dependencies of the pom file at the question. – Kevin Santiago Rey Aug 02 '21 at 14:58
  • 1
    Nothing at first glance seems to be wrong. You can try a `mvn dependencies:tree` or just check the `WEB-INF/lib` directory of the generated artifact. – M. Deinum Aug 02 '21 at 15:02
  • hi, did you eventually find a solution? – CodeLearner Feb 16 '23 at 14:06

0 Answers0