camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arno Noordover (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10135) Bean creation exception swallowed
Date Sat, 09 Jul 2016 20:38:11 GMT


Arno Noordover commented on CAMEL-10135:

It doesn't seem to be a bug.
The creation of the bean is done by org.apache.camel.model.BeanDefinition and begins by getting
the clazz on line 274.
Eventually the line 304 is executed
                        // this is only for invoking static methods on the bean
                        beanHolder = new ConstantStaticTypeBeanHolder(clazz, routeContext.getCamelContext());
My conclusion is that no instance is created because the processor is going to try and call
static methods on your bean-class.
When you add the following method to your bean
        public static String doSomeBrickletThing(String hello) {
            return "Camel in your house!";
you don't see any failure.

> Bean creation exception swallowed
> ---------------------------------
>                 Key: CAMEL-10135
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.15.1
>         Environment: Any
>            Reporter: Geert Schuring
>              Labels: beaninvocation, camel, constructor, exception-handling
>         Attachments:
> When a Route is referring to a Java Bean by class type while that class has no default
constructor, Camel should throw an exception indicating that creation of the bean failed.
Instead it ignores this problem resulting in an exchange encountering a null pointer exception.

This message was sent by Atlassian JIRA

View raw message