gnodet-bot commented on code in PR #26361:
URL: https://github.com/apache/camel/pull/26361#discussion_r3999782507


##########
dsl/camel-yaml-dsl/camel-yaml-dsl-deserializers/src/main/java/org/apache/camel/dsl/yaml/deserializers/BeansDeserializer.java:
##########
@@ -190,4 +190,29 @@ protected void bindLazyBean(
         model.addCustomBean(def);
     }
 
+    /**
+     * The cause of a bean that could not be created is a 
ClassNotFoundException more often than not (a wrong package, a
+     * missing dependency); say so, and for a Camel aggregation strategy 
written in the wrong package name the right
+     * one.
+     */
+    static String classNotFoundHint(Throwable e) {
+        for (Throwable t = e; t != null; t = t.getCause()) {
+            if (t instanceof ClassNotFoundException || t instanceof 
NoClassDefFoundError) {
+                String cls = t.getMessage() != null ? t.getMessage().trim() : 
"";

Review Comment:
   💡 Minor: `NoClassDefFoundError.getMessage()` returns the class name in 
internal format (`java/lang/Foo` instead of `java.lang.Foo`), so the hint would 
say "class java/lang/Foo was not found". Works fine for the user to identify 
the class, but worth knowing. Not blocking.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to