Search code examples
javamavenmoduleannotationswildfly

Wildfly 24 - Module Annotations not working?


I am having some problems deploying my application in Wildfly 24. I created a Module containing some jar's that aid my deployments executions. Some of those Jar's have annotations like @Entity and @WebService.

According with the Wildfly documentation, I created a global module in the standalone.xml like:

<global-modules>
        <module name="server.defs" annotations="true" />
</global-modules>

Also, I have created (via maven) the jandex index for both the jar in the module and the jar deployed. On opening the jar's I can see the jandex.idx on the META-INF folder. To do this i used in the pom.xml the following:

<plugin>
      <groupId>org.jboss.jandex</groupId>
      <artifactId>jandex-maven-plugin</artifactId>
      <version>1.1.1</version>
      <executions>
               <execution>
                     <id>make-index</id>
                      <goals>
                                <goal>jandex</goal>
                      </goals>
                </execution>
        </executions>
</plugin>

But when i start the server, its like the annotations are not parsed. Hibernate can't find the class's with the @Entity annotations and the class's using the @WebService annotations in the modules are failing to deploy.

If I don't use the modules, everything is deployed correctly.. Anyone has any idea of whats the problem?

Thank you!


Solution

  • I left the project in standby for a while and now I rebooted it. Answering the original question, yes you can have annotated class's in the modules directories.

    Just be sure every single dependency needed is included in the module.xml. You don't need any ' annotations="true" '.