Mule ExpressionRuntimeException Message payload is of type: LinkedList

走远了吗. 提交于 2019-12-11 10:50:06

问题


error message:

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)

code:

<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"/>

Problem is sometime value comes more than one from select query, how do I filter. I can do by filtering query by WHERE ROWNUM = 1, but how can I handle in Mule instead of this in query?


回答1:


Can you try with:

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

If this still throws an exception, please share the full ERROR not just the first line so I can refine my answer.



来源:https://stackoverflow.com/questions/30042884/mule-expressionruntimeexception-message-payload-is-of-type-linkedlist

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!