modulewildflywildfly-9

Unable to add a module to wildfly 9, module not found exception when loading war that refers to it


in my WEB-INF directory jboss-deployment-structure.xml

<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="com.ticomgeo.crowbar" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

in $JBOSS_HOME/modules/com/ticomgeo/crowbar/main modules.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.ticomgeo.crowbar">
    <resources>
        <resource-root path="properties"/>
    </resources>
</module>

war file fails to deploy with the following error

2018-03-28 17:52:25,195 ERROR [org.jboss.msc.service.fail] (MSC service     thread 1-6) MSC000001: Failed to start service jboss.module.service."deployment.crowbar-server.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.crowbar-server.war".main: WFLYSRV0179: Failed to load module: deployment.crowbar-server.war:main
    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:91)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.jboss.modules.ModuleNotFoundException: com.ticomgeo.crowbar:main
    at org.jboss.modules.Module.addPaths(Module.java:1042)
    at org.jboss.modules.Module.link(Module.java:1398)
    at org.jboss.modules.Module.relinkIfNecessary(Module.java:1426)
    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:238)
    at  org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:68)
    ... 5 more

Solution

  • It should be in a layer. The provided one being system/layers/base Thus creating your file in $JBOSS_HOME/modules/system/layers/base/com/ticomgeo/crowbar/main should make it work.