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

nfilotto pushed a commit to branch backports-to-4.8
in repository https://gitbox.apache.org/repos/asf/camel-karaf.git

commit ee09fbb7bc2abb6ce3856fff08966bc1d4ba3637
Author: François de Parscau <[email protected]>
AuthorDate: Mon Dec 9 19:03:39 2024 +0100

    Ref #553: fix usage of routeBuilder in blueprint (#554)
---
 .../org/apache/camel/blueprint/BlueprintContainerBeanRepository.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintContainerBeanRepository.java
 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintContainerBeanRepository.java
index e68b503c6..0e50c1646 100644
--- 
a/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintContainerBeanRepository.java
+++ 
b/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintContainerBeanRepository.java
@@ -61,13 +61,13 @@ public class BlueprintContainerBeanRepository implements 
BeanRepository {
         }
 
         // just to be safe
-        if (answer == null) {
+        if (!type.isInstance(answer)) {
             return null;
         }
 
         try {
             return type.cast(answer);
-        } catch (Throwable e) {
+        } catch (Exception e) {
             String msg = "Found bean: " + name + " in BlueprintContainer: " + 
blueprintContainer
                     + " of type: " + answer.getClass().getName() + " expected 
type was: " + type;
             throw new NoSuchBeanException(name, msg, e);

Reply via email to