You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/12/08 19:10:11 UTC

[camel] branch camel-3.0.x updated: CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.0.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-3.0.x by this push:
     new 72e36a9  CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.
72e36a9 is described below

commit 72e36a978aa5b057d54b67ce91f0c7582cdf4c13
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Dec 7 21:04:34 2019 +0100

    CAMEL-14272: Configuring endpoint with bean reference should fail if no such bean found when using source code generated configurer.
---
 .../org/apache/camel/support/component/PropertyConfigurerSupport.java | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java b/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
index bf5f772..4cdc655 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/component/PropertyConfigurerSupport.java
@@ -17,6 +17,7 @@
 package org.apache.camel.support.component;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.NoSuchBeanException;
 
 /**
  * Base class used by the camel-apt compiler plugin when it generates source code for fast
@@ -43,6 +44,9 @@ public abstract class PropertyConfigurerSupport {
                 Object obj = camelContext.getRegistry().lookupByName(ref);
                 if (obj != null) {
                     value = obj;
+                } else {
+                    // no bean found so throw an exception
+                    throw new NoSuchBeanException(ref, type.getName());
                 }
             }
         }