[英]SpelEvaluationException: EL1004E:(pos 0): Method call: Method hasPermission(java.lang.String) cannot be found on MethodSecurityExpressionRoot type
[英]SpelEvaluationException: EL1004E: Method call: Method getValue(java.lang.String) cannot be found on java.lang.String type
所有
我在本地服務器上運行spring cloud數據流。當我運行這樣定義的流時
http --port=8787 | transform --expression=payload.getValue('name') |
jdbc --columns=name --table-name=http_table --password=******
--driver-class-name=org.mariadb.jdbc.Driver --username=root --url='jdbc:mysql://127.0.0.1:3306/target_data'
我使用處理器變換
transform --expression=payload.getValue('name')
但是有這樣的錯誤
2017-09-16 20:01:57,561錯誤-kafka-listener-1 osklLoggingErrorHandler:37-處理時出錯:ConsumerRecord(topic = http_jdbc04.http,partition = 0,offset = 0,CreateTime = 1505563314419,checksum = 1043955671,已序列化密鑰大小= -1,序列化值大小= 102,密鑰=空,值= [B @ 5b1b4ce3)org.springframework.integration.transformer.MessageTransformationException:無法轉換消息; 嵌套異常是org.springframework.messaging.MessageHandlingException:嵌套異常是org.springframework.expression.spel.SpelEvaluationException:EL1004E:方法調用: 方法getValue(java.lang.String)在java.lang.String類型上找不到,failedMessage = GenericMessage [payload = {“ name”:“ world”},標頭= {kafka_offset = 0,id = 0392ca58-6644-91fb-9454-a41e83854955,kafka_receivedPartitionId = 0,contentType = application / json; charset = UTF-8, kafka_receivedTopic = http_jdbc04.http,時間戳= 1505563317552}]
這是我遵循spring-cloud-dataflow-docs的文檔
和Spring雲數據流版本:
1.spring cloud dataflow本地服務器1.2.3.RELEASE
2.Java:1.8.0
我解決了這個問題。
這行不通:
transform --expression=payload.getValue('name')
您應該使用#jsonPath(payload, '<json path expression>')
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.