Skip to content

Commit

Permalink
Capture RuntimeExceptions in dinamic class loading
Browse files Browse the repository at this point in the history
Since 9.x, if you deploy an war with two (or more wars) with different libraries, deployment crash since it's trying to load classes from one WAR with the classloader from the other WAR. This cross load is intended (see BeanDeploymentArchiveImpl, method isAccesible, line 246, WFLY-4250), but it's waiting for a null load, not a RuntimeException.

With this fix, a warn is registered in log but application can be loaded without major problems.
  • Loading branch information
Dawuid authored and n1hility committed Sep 23, 2015
1 parent 011c2f3 commit 8c3680a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion weld/src/main/java/org/jboss/as/weld/util/Reflections.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public static boolean isAccessible(String className, ClassLoader classLoader) {
public static <T> Class<T> loadClass(String className, ClassLoader classLoader) {
try {
return cast(classLoader.loadClass(className));
} catch (Exception e) {
} catch (Throwable e) {
return null;
}
}
Expand Down

0 comments on commit 8c3680a

Please sign in to comment.