ule子ExpressionRuntimeException消息有效负载的类型为:LinkedList [英] Mule ExpressionRuntimeException Message payload is of type: LinkedList

查看:115
本文介绍了ule子ExpressionRuntimeException消息有效负载的类型为: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"/>

问题是有时候值会从选择查询中传出多个,我该如何过滤.我可以通过WHERE ROWNUM = 1过滤查询来完成操作,但是如何在Mule中处理而不是在查询中处理呢?

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?

推荐答案

可以尝试:

#[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.

这篇关于ule子ExpressionRuntimeException消息有效负载的类型为:LinkedList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆