The JBoss Modules manual has been moved to this location. Contributions and edits can be submitted to the GitHub repository manual branch.
Jan 13, 2012
How about the <system> element?
Apr 21, 2012
An example would be really helpful for the part when you say:
"In particular, its location on the filesystem is calculated by converting the dot-separated segments of the module name to path elements, followed by a path element which consists of the version slot for that module. This path is then appended to each module path root in turn until a file named module.xml is found within it."
I came across this section just looking to solve a business problem of having a jar exposed to all my wars. A step by step tutorial on how to do so is sorely needed.
Apr 18, 2013
Can someone please provide an example for the following:
"It is possible to define resource roots for a module which correspond to JAR files as well as file system directories, just like class paths. File system directory resource roots have the additional property of supporting the specification of native libraries, which cannot be loaded from JAR files."
Is it possible to use a <resource-root path="/home/me/bin"/> to find/load /home/me/bin/myClass.class at runtime?
Yes, using an absolute path to a directory should work exactly the same as if you had put that directory on a class path.
Apr 23, 2013
Thanks for the reply. I never got the absolute paths to work...tried both Windows (well, Cygwin) and RHEL 5.4. I ended up having to use a nasty relative path <resource-root path="../../../../../home/me/bin"/> to find/load /home/me/bin/myClass.class at runtime. JBoss7.1.1...hope it helps someone else. Cheers.
Jun 25, 2013
I'm not sure if it was intentional but looking at the implementation, it doesn't look like it supports absolute paths for the "path" attribute of a resource-root element https://github.com/jbossas/jboss-modules/blob/master/src/main/java/org/jboss/modules/ModuleXmlParser.java#L133. That line considers the path to be always relative to the "rootPath" which turns out to be the folder containing the module.xml being parsed.
OK I'll have to check it out.
Jul 04, 2013
Great job! I still have a lot of unanswered questions, though.
First off, what is the purpose of the module-alias?
When should it be used? Can you give us an example?
Any help would be greatly appreciated.
Thanks in advance!
Jul 08, 2013
Module aliases are used to allow a module to be loaded by another name. For example in WildFly, the "org.apache.commons.logging" module is actually an alias for "org.slf4j.jcl-over-slf4j".
Sep 04, 2013
"See the section on filter definition for more information about defining filters." - Where can I find this section?
Feb 25, 2014
Not completed, unfortunately.
Jan 05, 2014
How to name the jboss modules xml ? Which directory should the module xml be placed?
The static module loader expects the module descriptor to be named "module.xml" and to reside in the directory corresponding to the module based on its name (where dots are replaced with the platform file separator) and slot (which forms the last segment of the directory name).
Feb 19, 2014
It looks like the <system> <paths> element takes an undocumented "optional" attribute, which is good because I think I need it
(at least, I don't get a startup error when I do this - I did get errors when I tried <system optional="true"> and <path name="..." optional="true" />)
It does not. However I have a bad habit of not making sure that elements with no attributes are really given no attributes - in this case the attribute is simply ignored rather than rejected. I'll comment further on that JIRA.
Nov 07, 2014
I found no easy way how to make a module, I would like to have a plugin that could generate the module.xml and all needed jars. I have started to develop a simple gradle plugin that allows to build JBoss Modules. You can define custom module using gradle dependencies and groovy. Also you have an access to modules under JBoss Server.
Jan 23, 2015
Under JBoss EAP 6.2, I have a module to access an external file resource, using a relative path like this
<resource-root path="../../../../../resources, but it doesn't seem to work. How can I tell
if the module.xml file is being read by JBoss?
Assuming you're talking about a module.xml file, whether or not it is read, that won't work because static module resource roots cannot "escape" their module directories. Instead, you could put a symbolic link to your resources directory and add that to the module resource roots list.
Jul 23, 2015
It doesn't mean anything if you do it. The module properties are just arbitrary key-value pairs. JBoss AS and WildFly look for a "jboss.api" property when deployments depend on a module, to warn you if you're using a module that might get removed from the distribution.
If you have more questions, please refer to the user forums at https://developer.jboss.org/en/wildfly?view=discussions.
Mar 10, 2016
My resource-root tag looks like this...
<resource-root path="#folderName" />where "#folderName" folder contains jars I need to include in the module. However, these jars do not appear accessible to a deployment which has this module as a dependency. Is this syntax not allowed? I know for a fact that this syntax is valid for deployment resources. Is there a problem when I do this for modules?
Correct, at present you must list each class path JAR and directory as separate resource roots. Directories of JARs are not recursed.
Mar 15, 2017
Just note about <exports> section: When booth, <exclude> and <include>, are used and more of them match package of classloaded file, first (most-top) matching rule is used.
Also does not depend if the exclusion/inclusion is done using <include-set> or <include> element - only on order in module.xml file.
And maybe the most importent: filter applies on package - it is not possible to filter individual classes.
(maybe should be mentioned in this doc)
Powered by a free Atlassian Confluence Open Source Project License granted to Red Hat, Inc.. Evaluate Confluence today.