Search code examples
spring-bootdeploymentjboss

JBAS015852: Could not index class module-info.class - Spring boot + Jboss 7.1.1


I am trying to deploy a simple Spring boot application on a Jboss 7.1.1. I have made the corresponding settings, but the error continuously appears: "JBAS015852: Could not index class module-info.class"

I made the following settings:

@SpringBootApplication
public class DemoApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
    return application.sources(DemoApplication.class);
}

public static void main(String[] args) {
    SpringApplication.run(DemoApplication.class, args);
}

@RestController
class Hellocontroller {
    @RequestMapping("/hello")
    @GetMapping
    String hello() {
        return "Hola";
    }
}

and in the pom.xml

<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>

but I have the following result

16:12:16,317 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015852: Could not index class org/hibernate/validator/spi/scripting/AbstractCachingScriptEvaluatorFactory.class at /C:/Users/User/Downloads/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final/standalone/deployments/demo.war/WEB-INF/lib/hibernate-validator-6.0.19.Final.jar: java.lang.IllegalStateException: Unknown tag! pos=4 poolCount = 71
at org.jboss.jandex.Indexer.processConstantPool(Indexer.java:606) [jandex-1.0.3.Final.jar:1.0.3.Final]
at org.jboss.jandex.Indexer.index(Indexer.java:640) [jandex-1.0.3.Final.jar:1.0.3.Final]
at org.jboss.as.server.deployment.annotation.ResourceRootIndexer.indexResourceRoot(ResourceRootIndexer.java:77) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.annotation.AnnotationIndexProcessor.deploy(AnnotationIndexProcessor.java:51) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_80]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_80]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_80]

I need your support, thanks.


Solution

  • The problem was due to dependency conflict, which I could exclude using the following jboss-deployment-structure.xml

        <?xml version='1.0' encoding='UTF-8'?>
    <jboss-deployment-structure
        xmlns="urn:jboss:deployment-structure:1.1">
        <deployment>
            <exclusions>
                <module name="com.fasterxml.jackson.core.jackson-annotations" />
                <module name="com.fasterxml.jackson.core.jackson-core" />
                <module name="com.fasterxml.jackson.core.jackson-databind" />
                <module
                    name="com.fasterxml.jackson.jaxrs.jackson-jaxrs-json-provider" />
                <module name="org.jboss.resteasy.resteasy-jackson2-provider" />
                <module name="org.slf4j" />
            </exclusions>
        </deployment>
    </jboss-deployment-structure>