FELIX-644 : Throw exception with better message.

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@680024 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java
index 576c08a..0bd8d72 100644
--- a/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java
+++ b/scrplugin/src/main/java/org/apache/felix/scrplugin/tags/cl/ClassLoaderJavaClassDescription.java
@@ -130,6 +130,12 @@
         Method m = null;
         try {
             m = this.clazz.getDeclaredMethod(name, classParameters);
+        } catch (NoClassDefFoundError ncdfe) {
+            // if this occurs it usually means that a problem with the maven
+            // scopes exists.
+            throw new MojoExecutionException("Class loading error. This error usually occurs if you have a " +
+                    "service inheriting from a class coming from another bundle and that class using a " +
+                    "third library and all dependencies are specified with scope 'provided'.", ncdfe);
         } catch (NoSuchMethodException e) {
             // ignore this
         }