You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Alex Soto <al...@envieta.com> on 2016/02/26 23:07:45 UTC

Bean instance is null. OGNL bean expressions requires bean instances.

Hello,

Running Camel 2.16.1, I am trying to invoke a static method as follows:

<setHeader headerName="SCMS_MATCH_FILE_NAME">
	<method 
			beanType="org.apache.camel.util.StringHelper"
			method="removeLeadingAndEndingQuotes(${header.If-None-Match})"
	 />
</setHeader>


However I get an exception with this message:

Bean instance is null. OGNL bean expressions requires bean instances.

Any idea why?

Thanks and best regards,
Alex soto




Re: Bean instance is null. OGNL bean expressions requires bean instances.

Posted by Alex Soto <al...@envieta.com>.
Thank you Claus,

Best regards,
Alex soto



> On Feb 28, 2016, at 1:30 AM, Claus Ibsen <cl...@gmail.com> wrote:
> 
> I logged a ticket
> https://issues.apache.org/jira/browse/CAMEL-9653
> 
> On Sat, Feb 27, 2016 at 7:25 AM, Claus Ibsen <cl...@gmail.com> wrote:
>> It was not designed primary to call utility methods, but methods on
>> your existing message body and headers - where there is an instance.
>> 
>> You are welcome to log a JIRA ticket to see if we can adjust it to use
>> static methods only.
>> http://camel.apache.org/support.html
>> 
>> On Fri, Feb 26, 2016 at 11:07 PM, Alex Soto <al...@envieta.com> wrote:
>>> Hello,
>>> 
>>> Running Camel 2.16.1, I am trying to invoke a static method as follows:
>>> 
>>> <setHeader headerName="SCMS_MATCH_FILE_NAME">
>>>        <method
>>>                        beanType="org.apache.camel.util.StringHelper"
>>>                        method="removeLeadingAndEndingQuotes(${header.If-None-Match})"
>>>         />
>>> </setHeader>
>>> 
>>> 
>>> However I get an exception with this message:
>>> 
>>> Bean instance is null. OGNL bean expressions requires bean instances.
>>> 
>>> Any idea why?
>>> 
>>> Thanks and best regards,
>>> Alex soto
>>> 
>>> 
>>> 
>> 
>> 
>> 
>> --
>> Claus Ibsen
>> -----------------
>> http://davsclaus.com @davsclaus
>> Camel in Action 2: https://www.manning.com/ibsen2
> 
> 
> 
> -- 
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2


Re: Bean instance is null. OGNL bean expressions requires bean instances.

Posted by Claus Ibsen <cl...@gmail.com>.
I logged a ticket
https://issues.apache.org/jira/browse/CAMEL-9653

On Sat, Feb 27, 2016 at 7:25 AM, Claus Ibsen <cl...@gmail.com> wrote:
> It was not designed primary to call utility methods, but methods on
> your existing message body and headers - where there is an instance.
>
> You are welcome to log a JIRA ticket to see if we can adjust it to use
> static methods only.
> http://camel.apache.org/support.html
>
> On Fri, Feb 26, 2016 at 11:07 PM, Alex Soto <al...@envieta.com> wrote:
>> Hello,
>>
>> Running Camel 2.16.1, I am trying to invoke a static method as follows:
>>
>> <setHeader headerName="SCMS_MATCH_FILE_NAME">
>>         <method
>>                         beanType="org.apache.camel.util.StringHelper"
>>                         method="removeLeadingAndEndingQuotes(${header.If-None-Match})"
>>          />
>> </setHeader>
>>
>>
>> However I get an exception with this message:
>>
>> Bean instance is null. OGNL bean expressions requires bean instances.
>>
>> Any idea why?
>>
>> Thanks and best regards,
>> Alex soto
>>
>>
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> http://davsclaus.com @davsclaus
> Camel in Action 2: https://www.manning.com/ibsen2



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Re: Bean instance is null. OGNL bean expressions requires bean instances.

Posted by Claus Ibsen <cl...@gmail.com>.
It was not designed primary to call utility methods, but methods on
your existing message body and headers - where there is an instance.

You are welcome to log a JIRA ticket to see if we can adjust it to use
static methods only.
http://camel.apache.org/support.html

On Fri, Feb 26, 2016 at 11:07 PM, Alex Soto <al...@envieta.com> wrote:
> Hello,
>
> Running Camel 2.16.1, I am trying to invoke a static method as follows:
>
> <setHeader headerName="SCMS_MATCH_FILE_NAME">
>         <method
>                         beanType="org.apache.camel.util.StringHelper"
>                         method="removeLeadingAndEndingQuotes(${header.If-None-Match})"
>          />
> </setHeader>
>
>
> However I get an exception with this message:
>
> Bean instance is null. OGNL bean expressions requires bean instances.
>
> Any idea why?
>
> Thanks and best regards,
> Alex soto
>
>
>



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2