0
votes

I upgraded my application from mule 3.4.2 to 3.5.2 version after which im facing the below given exception while processing x12 files.

2014-12-18 06:41:41,062 [[unionstation-15.1-SNAPSHOT].httpsConnector.receiver.18] ERROR org.mule.exception.DefaultMessagingExceptionStrategy -
********************************************************************************
Message               : Expression Evaluator "header" with expression "invocation:username" returned null but a value was required. (org.mule.api.expression.RequiredValueException). Message payload is of type: ContentLengthInputStream
Code                  : MULE_ERROR-29999
--------------------------------------------------------------------------------
Exception stack is:
1. Expression Evaluator "header" with expression "invocation:username" returned null but a value was required. (org.mule.api.expression.RequiredValueException)
  org.mule.expression.ExpressionUtils:235 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/RequiredValueException.html)
2. Expression Evaluator "header" with expression "invocation:username" returned null but a value was required. (org.mule.api.expression.RequiredValueException). Message payload is of type: ContentLengthInputStream (org.mule.api.MessagingException)
  org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
org.mule.api.expression.RequiredValueException: Expression Evaluator "header" with expression "invocation:username" returned null but a value was required.
        at org.mule.expression.ExpressionUtils.getPropertyInternal(ExpressionUtils.java:235)
        at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:63)
        at org.mule.expression.ExpressionUtils.getPropertyWithScope(ExpressionUtils.java:46)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************

Does anyone face the same issue sometime?

2

2 Answers

1
votes

You don't have the flow variable username at that point on your application for a undetermined reason. Please review where you are adding that variable and check that code is actually executed.

If you need further help you should share the flow/s involved in setting and reading that variable.

0
votes

I have the same error in mule studio 3.5.0.

I read all headers and access the element in the map as a workaround:

@ContainsTransformerMethods
public class HttpToUserTransformer {
    @Transformer
    public User stringToUser(@Payload String s, @InboundHeaders("*") Map<String, String> headers) {
        User user = new User();
        user.setName(headers.get("name"));
        return user;
    }
}