WildFly 26 bootable jar fails on missing dependencies error running a deployable EAR. Why?

74 Views Asked by At

I have a working EAR that is deployed onto WildFly 26 and would like to build a bootable jar of that EAR using the wildfly-jar-maven-plugin. The maven plugin is setup with the feature pack for WF26, a fair number of layers configured, plus a cli script that sets up the datasources. It is clear to me that there are quite a few missing settings still.

<profile>
    <id>build-bootable-jar</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-jar-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <display-cli-scripts-output>true</display-cli-scripts-output>
                    <feature-packs>
                        <feature-pack>
                            <location>wildfly@maven(org.jboss.universe:community-universe)#${wildfly.version}</location>
                        </feature-pack>
                    </feature-packs>
                    <layers>
                        <layer>ejb</layer>
                        <layer>bean-validation</layer>
                        <layer>cdi</layer>
                        <layer>ee-security</layer>
                        <layer>jaxrs</layer>
                        <layer>messaging-activemq</layer>
                        <layer>jpa</layer>
                        <layer>observability</layer>
                        <layer>resource-adapters</layer>
                        <layer>transactions</layer>
                        <layer>web-server</layer>
                        <layer>jsonb</layer>
                        <layer>naming</layer>
                        <layer>jaxrs-server</layer>
                    </layers>
                    <cli-sessions>
                        <cli-session>
                            <properties-file>
                                ../project.properties
                            </properties-file>
                            <script-files>
                                <script>src/main/bootable/bootable.cli</script>
                            </script-files>
                        </cli-session>
                    </cli-sessions>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>
<profile>
    <id>run-bootable-jar</id>
    <build>
        <plugins>
            <plugin>
                <groupId>org.wildfly.plugins</groupId>
                <artifactId>wildfly-jar-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                </configuration>
            </plugin>
        </plugins>
    </build>
</profile>

I'd expect configuration issues, but not the failure of WF to start due to missing dependencies (since the EAR is deployable).

14:34:50,978 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "ioserver-ear.ear")]) - failure description: {
    "WFLYCTL0412: Required services that are not installed:" => [
        "module.resolved.service.\"deployment.ioserver-ear.ear.export-newcore.jar\".main",
        "module.resolved.service.\"deployment.ioserver-ear.ear.import-entity.jar\".main",
        ...
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
    "jboss.module.service.\"deployment.ioserver-ear.ear.license-server.jar\".main is missing [module.resolved.service.\"deployment.ioserver-ear.ear.license-server.jar\".main]",
    "jboss.module.resolve.phase.\"deployment.ioserver-ear.ear.arrangement.jar\".main.2 is missing [jboss.module.spec.service.\"deployment.ioserver.ear.export.jar\".main, jboss.module.spec.service.\"on.jar\".main, jboss.module.spec.service.\"deployment.ioserver.ear.db.jar\".main, jboss.module.spec.service.\"deployment.ioserver.ear.entity.jar\".main, jboss.module.spec.service.\"deployment.ioserver.ear.entityejb3.jar\".main, jboss.module.spec.service.\"deployment.ioserver.ear.payroll-export.jar\".main]",
    ...

The logging is a lot more of these lines, but leaves not much of a clue (to me) of why it is failing, except on missing dependencies which should not be missing at all. Also it seems things are depending on themselves:

"jboss.module.service.\"deployment.ioserver-ear.ear.ons-api.war\".main is missing [module.resolved.service.\"deployment.ioserver-ear.ear.ons-api.war\".main]",

Any suggestions where to look? For completeless a tree of the EAR:

> tree
.
|____import.jar
|____...
|____code.jar
|____import-entity.jar
|____...
|____report.jar
|____export-newcore.jar
|____...
|____META-INF
| |____application.xml
| |____jboss-deployment-structure.xml
|____lib
| |____perfmark-api-0.26.0.jar
| |____api-grpc-3.0.jar
| |____...

Addendum:

I also have a number of "Class Path entry ... does not point to a valid jar for a Class-Path reference" lines, also for jars coming from outside my project, like jaxws-rt. Consensus on the internet is that these WARNings can be ignored, but this issue could have applied: access.redhat.com/solutions/1328573 However, the inspection of a few MANIFEST.MF show this is not likely: there are no Class-Path entries in our jars. (There are in 3rd party.)

I notice that the standalone/tmp/war folders in the unpacked folder structure are empty, but maybe WF hasn't gotten around to unpacking them. The jar files are present in standalone/tmp/vfs/deployment/deploymentXXX/ (but their content folders are empty again).

After enabling deploy logging I see that the modules are deployed. Debugging WildFly I see module descriptors being created. So WildFly is booting correctly. What is strange is that most of the missing messages are the modules missing itself:

jboss.module.service."XXX".main is missing module.resolved.service."XXX".main
0

There are 0 best solutions below