Results 1 to 2 of 2

Thread: Section 6.2.2 Header Enricher -- POJO example won't work.

  1. #1
    Join Date
    Jul 2012
    Location
    Cupertino, CA
    Posts
    24

    Default Section 6.2.2 Header Enricher -- POJO example won't work.

    Tested on 2.2.0.M4
    http://static.springsource.org/sprin...ce/htmlsingle/

    Code:
    <int:header-enricher input-channel="in" output-channel="out">
        <int:header name="foo" method="computeValue" ref="myBean"/>
    </int:header-enricher>
    
    <bean id="myBean" class="foo.bar.MyBean"/>
    Code:
    public class MyBean {
        public String computeValue(String payload){
            return payload.toUpperCase() + "_US";
        }
    }

    If my method argument (payload) is String, I got the following exception:

    Code:
    Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 8): Method call: Method setBasicCredentials(org.springframework.util.LinkedMultiValueMap) cannot be found on com.bababa.haha.integration.http.ProfileRequestHandler type
            at org.springframework.expression.spel.ast.MethodReference.findAccessorForMethod(MethodReference.java:182)
            at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:106)
            at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:57)
            at org.springframework.expression.spel.ast.SpelNodeImpl.getTypedValue(SpelNodeImpl.java:102)
            at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:102)
            at org.springframework.integration.util.AbstractExpressionEvaluator.evaluateExpression(AbstractExpressionEvaluator.java:126)
            at org.springframework.integration.util.MessagingMethodInvokerHelper.processInternal(MessagingMethodInvokerHelper.java:227)
            at org.springframework.integration.util.MessagingMethodInvokerHelper.process(MessagingMethodInvokerHelper.java:127)

    Don't know where LinkedMultiValueMap comes from.


    Workaround:

    The method argument being Message.

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    735

    Default

    Hello

    LinkedMultiValueMap may come from http-ibound as a presentation of request parameters.
    And sorry: I don't understand what side here is header-enricher?..

    Cheers,
    Artem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •