From e81fdbd7c7b7388b079edc8c2ec170fa1e7aba18 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 12 Jun 2019 13:38:45 -0500 Subject: [PATCH] Issue #3736 - Give better exception when using bad classloader impl Signed-off-by: Joakim Erdfelt --- .../main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java index 967b9e5feaa..e043e6fb797 100644 --- a/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java +++ b/jetty-webapp/src/main/java/org/eclipse/jetty/webapp/WebAppClassLoader.java @@ -498,7 +498,9 @@ public class WebAppClassLoader extends URLClassLoader implements ClassVisibility // Try the parent loader try { - parent_class = _parent.loadClass(name); + parent_class = _parent.loadClass(name); + if (parent_class == null) + throw new ClassNotFoundException("Bad ClassLoader: returned null for loadClass(" + name + ")"); // If the webapp is allowed to see this class if (Boolean.TRUE.equals(__loadServerClasses.get()) || !_context.isServerClass(parent_class))