Skip to content

Commit

Permalink
[EJBCLIENT-458] Restore exception handling semantics prior to EJBCLIE…
Browse files Browse the repository at this point in the history
…NT-417 (wildfly#575)
  • Loading branch information
bstansberry authored and ivassile committed Nov 1, 2022
1 parent 74457fb commit 23b4cca
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ private static <T> Class<? extends T> parseClassType(final ConfigurationXMLStrea
ClassLoader cl;
if (moduleName != null) {
try {
cl = Module.getModuleFromCallerModuleLoader(moduleName).getClassLoader();
} catch (ModuleLoadException e) {
throw new ConfigXMLParseException(e);
cl = ModuleLoadDelegate.loadModule(moduleName);
} catch (LinkageError e) {
throw Logs.MAIN.noJBossModules(streamReader);
}
Expand All @@ -271,6 +269,16 @@ private static <T> Class<? extends T> parseClassType(final ConfigurationXMLStrea
throw streamReader.unexpectedElement();
}

static final class ModuleLoadDelegate {
static ClassLoader loadModule(String moduleName) throws ConfigXMLParseException {
try {
return Module.getModuleFromCallerModuleLoader(moduleName).getClassLoader();
} catch (ModuleLoadException e) {
throw new ConfigXMLParseException(e);
}
}
}

private static void parseConnectionsType(final ConfigurationXMLStreamReader streamReader, final EJBClientContext.Builder builder) throws ConfigXMLParseException {
if (streamReader.getAttributeCount() > 0) {
throw streamReader.unexpectedAttribute(0);
Expand Down

0 comments on commit 23b4cca

Please sign in to comment.