use of org.jboss.modules.ModuleLoadException in project wildfly by wildfly.
the class JSFSharedTldsProcessor method init.
private void init() {
JSFModuleIdFactory moduleFactory = JSFModuleIdFactory.getInstance();
List<String> jsfSlotNames = moduleFactory.getActiveJSFVersions();
for (String slot : jsfSlotNames) {
final List<TldMetaData> jsfTlds = new ArrayList<TldMetaData>();
try {
ModuleClassLoader jsf = Module.getModuleFromCallerModuleLoader(moduleFactory.getImplModId(slot)).getClassLoader();
for (String tld : JSF_TAGLIBS) {
InputStream is = jsf.getResourceAsStream("META-INF/" + tld);
if (is != null) {
TldMetaData tldMetaData = parseTLD(is);
jsfTlds.add(tldMetaData);
}
}
} catch (ModuleLoadException e) {
// Ignore
} catch (Exception e) {
// Ignore
}
jsfTldMap.put(slot, jsfTlds);
}
}
use of org.jboss.modules.ModuleLoadException in project wildfly-swarm by wildfly-swarm.
the class ApplicationEnvironment method getBootstrapClassLoader.
public ClassLoader getBootstrapClassLoader() throws ModuleLoadException {
if (this.mode == Mode.UBERJAR) {
try {
// ClassLoader cl = Module.getBootModuleLoader().loadModule("org.wildfly.swarm.bootstrap").getClassLoader();
Module module = Module.getBootModuleLoader().loadModule("org.wildfly.swarm.bootstrap");
ClassLoader cl = module.getClassLoader();
return cl;
} catch (ModuleLoadException e) {
// ignore
}
}
return ApplicationEnvironment.class.getClassLoader();
}
use of org.jboss.modules.ModuleLoadException in project wildfly-swarm by wildfly-swarm.
the class BootstrapClasspathModuleFinderTest method testMissingSlot.
@Test
public void testMissingSlot() {
BootstrapClasspathModuleFinder finder = new BootstrapClasspathModuleFinder();
try {
ModuleSpec spec = finder.findModule("classpath.module.load.test:missing", null);
assertNull(spec);
} catch (ModuleLoadException e) {
fail();
}
}
use of org.jboss.modules.ModuleLoadException in project wildfly-swarm by wildfly-swarm.
the class ClasspathModuleFinderTest method testMain.
@Test
public void testMain() {
ClasspathModuleFinder finder = new ClasspathModuleFinder();
try {
ModuleSpec spec = finder.findModule("classpath.module.load.test", null);
assertNotNull(spec);
} catch (ModuleLoadException e) {
fail();
}
}
use of org.jboss.modules.ModuleLoadException in project wildfly-swarm by wildfly-swarm.
the class ClasspathModuleFinderTest method testMissingMain.
@Test
public void testMissingMain() {
ClasspathModuleFinder finder = new ClasspathModuleFinder();
try {
ModuleSpec spec = finder.findModule("classpath.module.load.test.missing", null);
assertNull(spec);
} catch (ModuleLoadException e) {
fail();
}
}
Aggregations