In org.jboss.modules.ModuleClassLoader.defineClass(String, ClassSpec)
The following code is not correct:
PackageSpec spec = null; for (ResourceLoader loader : loaders) { try { spec = loader.getPackageSpec(packageName); if (spec != null) { break; } } catch (IOException e) { // skip } }
because actually the getPackageSpec() method never returns null.
So, if a package is declared in a later jar in the loaders list, the package spec will be loaded with the default options of the first jar of the list, instead of the option of the container jar of the package.