diff --git a/src/main/org/apache/tools/ant/ComponentHelper.java b/src/main/org/apache/tools/ant/ComponentHelper.java index 574a7a05e..f98b12ede 100644 --- a/src/main/org/apache/tools/ant/ComponentHelper.java +++ b/src/main/org/apache/tools/ant/ComponentHelper.java @@ -465,6 +465,10 @@ public class ComponentHelper { String msg = " +Task: " + taskType; project.log (msg, Project.MSG_DEBUG); return task; + } catch (NoClassDefFoundError ncdfe) { + String msg = "Task " + taskType + ": A class needed by class " + + c + " cannot be found: " + ncdfe.getMessage(); + throw new BuildException(msg, ncdfe); } catch (Throwable t) { System.out.println("task CL=" + c.getClassLoader()); String msg = "Could not create task of type: " diff --git a/src/main/org/apache/tools/ant/taskdefs/Definer.java b/src/main/org/apache/tools/ant/taskdefs/Definer.java index f69272638..bf960dc7f 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Definer.java +++ b/src/main/org/apache/tools/ant/taskdefs/Definer.java @@ -250,7 +250,7 @@ public abstract class Definer extends Task { + " cannot be found"; throw new BuildException(msg, cnfe, getLocation()); } catch (NoClassDefFoundError ncdfe) { - String msg = getTaskName() + "A class needed on loading by class " + String msg = getTaskName() + ": A class needed by class " + value + " cannot be found: " + ncdfe.getMessage(); throw new BuildException(msg, ncdfe, location); }