ModuleLoadException: Error loading module from .../module.xml in JBoss EAP 6

Solution Verified - Updated -

Issue

  • We have a custom module such as:

$JBOSS_HOME/modules/com/examples/my/module/main/module.xml :

<module xmlns="urn:jboss:module:1.1" name="com.examples.my.module">
<resources>
  <resource-root path="custom-module-lib.jar"/>
</resources>
</module>

And our jar custom-module-lib.jar is in $JBOSS_HOME/modules/com/examples/my/module/main/

When we start JBoss EAP with an application (example-app.jar) that has a module dependency on our custom module (com.examples.my.module), we are seeing this exception below:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.module.service."deployment.example-app.jar".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.example-app.jar".main: JBAS018759: Failed to load module: deployment.example-app.jar:main
    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:92) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_30]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_30]
    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_30]
Caused by: org.jboss.modules.ModuleLoadException: Error loading module from /opt/jboss-eap-6.1.0/modules/com/examples/my/module/module.xml
    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:292) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:256) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.LocalModuleFinder$1.run(LocalModuleFinder.java:144) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.LocalModuleFinder$1.run(LocalModuleFinder.java:138) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_30]
    at org.jboss.modules.LocalModuleFinder.findModule(LocalModuleFinder.java:138) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleLoader.findModule(ModuleLoader.java:389) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleLoader.loadModuleLocal(ModuleLoader.java:293) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleLoader.preloadModule(ModuleLoader.java:240) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.Module.addPaths(Module.java:936) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.Module.link(Module.java:1304) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.Module.relinkIfNecessary(Module.java:1332) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:226) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:71) [jboss-as-server-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    ... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,38]
Message: Failed to add resource root 'custom-module-lib.jar' at path 'custom-module-lib.jar'
    at org.jboss.modules.ModuleXmlParser.parseResourceRoot(ModuleXmlParser.java:756) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseResources(ModuleXmlParser.java:712) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleContents(ModuleXmlParser.java:538) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseDocument(ModuleXmlParser.java:369) [jboss-modules.jar:1.2.0.Final-redhat-1]
    at org.jboss.modules.ModuleXmlParser.parseModuleXml(ModuleXmlParser.java:287) [jboss-modules.jar:1.2.0.Final-redhat-1]
    ... 18 more

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.1.0
    • 6.0.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In