diff --git a/core/src/main/java/org/infinispan/util/Util.java b/core/src/main/java/org/infinispan/util/Util.java index c08554f..220007e 100644 --- a/core/src/main/java/org/infinispan/util/Util.java +++ b/core/src/main/java/org/infinispan/util/Util.java @@ -142,17 +142,16 @@ } catch (ClassNotFoundException ce) { e = ce; } catch (NoClassDefFoundError ce) { + log.unableToLoadClass(classname, Arrays.toString(cls), ne); ne = ce; } } - if (e != null) - throw e; - else if (ne != null) { - // Before we wrap this, make sure we appropriately log this. - log.unableToLoadClass(classname, Arrays.toString(cls), ne); + if (ne != null) { + // The class was actually found, but likely some dependency was not. throw new ClassNotFoundException(classname, ne); - } + } else if (e != null) + throw e; else throw new IllegalStateException(); }