Mule ExpressionRuntimeException 消息负载的类型为:LinkedList

Mule ExpressionRuntimeException Message payload is of type: LinkedList

错误信息:

Message               : Execution of the expression "payload.get(0).get('ACCESS_TOKEN')" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: LinkedList
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Index: 0, Size: 0 (java.lang.IndexOutOfBoundsException)
  java.util.LinkedList:553 (null)
2. null (java.lang.reflect.InvocationTargetException)
  sun.reflect.GeneratedMethodAccessor323:-1 (null)
3. cannot invoke method: get (java.lang.RuntimeException)
  org.mule.mvel2.optimizers.impl.refl.nodes.MethodAccessor:63 (null)
4. Execution of the expression "payload.get(0).get('ACCESS_TOKEN')" failed. (org.mule.api.expression.ExpressionRuntimeException)
  org.mule.el.mvel.MVELExpressionLanguage:202 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/expression/ExpressionRuntimeException.html)
5. Execution of the expression "payload.get(0).get('ACCESS_TOKEN')" failed. (org.mule.api.expression.ExpressionRuntimeException). Message payload is of type: LinkedList (org.mule.api.transformer.TransformerMessagingException)

代码:

<db:select config-ref="QB_Oracle_Configuration" doc:name="Access">
     <db:parameterized-query><![CDATA[select access_token, access_token_secret from sias_access where EMPLID=#[message.inboundProperties['p_emplId']] AND TRINET_COMPANY=#[message.inboundProperties['p_company']]]]></db:parameterized-query>
</db:select> 
<set-session-variable variableName="accessToken" value="#[payload.get(0).get('ACCESS_TOKEN')]" doc:name="Access token"/>

问题是 select 查询中有时值不止一个,我该如何过滤。我可以通过 WHERE ROWNUM = 1 过滤查询来完成,但是我如何在 Mule 中处理而不是在查询中处理这个?

你可以试试:

#[message.payload[0]['ACCESS_TOKEN']]

如果这仍然引发异常,请分享完整的错误,而不仅仅是第一行,以便我改进我的答案。