Search code examples
spring-bootwildflyjoinfaces

Use joinfaces with war in wildfly 10


I'm using joinfaces and trying to get up with wildfly 10, but it's like having a tomcat embedded inside the dependency.

<dependency>
    <groupId>org.joinfaces</groupId>
    <artifactId>jsf-spring-boot-starter</artifactId>
    <version>2.4.0</version>
</dependency>

I made the necessary config

@SpringBootApplication
public class LicitarApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(LicitarApplication.class, args);
    }
    @Override
    public SpringApplicationBuilder configure(SpringApplicationBuilder application){
        return application.sources(LicitarApplication.class);
    }
}

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <!--<version>3.1.0</version>-->
        </dependency>

It starts but when it almost ends it gives error: NoSuchMethodError: DigesterFactory.newDigester

java.lang.NoSuchMethodError: org.apache.tomcat.util.descriptor.DigesterFactory.newDigester(ZZLorg/apache/tomcat/util/digester/RuleSet;Z)Lorg/apache/tomcat/util/digester/Digester;

Solution

  • I'm not sure if it's the best option, but for me this problem was solved when I remove the jar dependency tomcat-embed-jasper. I've just inserted the code below in my pom.xml:

        <dependency>
            <groupId>org.joinfaces</groupId>
            <artifactId>jsf-spring-boot-starter</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.tomcat.embed</groupId>
                    <artifactId>tomcat-embed-jasper</artifactId>
                </exclusion>
            </exclusions>
        </dependency>