SpelEvaluationException:EL1004E:方法调用:无法在 java.lang.String 类型上找到方法 getValue(java.lang.String)
SpelEvaluationException: EL1004E: Method call: Method getValue(java.lang.String) cannot be found on java.lang.String type
全部
I 运行 spring 云数据流与本地 server.when i 运行 定义如下的流
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 ERROR -kafka-listener-1 o.s.k.l.LoggingErrorHandler:37 - Error while processing:
ConsumerRecord(topic = http_jdbc04.http, partition = 0, offset = 0,
CreateTime = 1505563314419, checksum = 1043955671, serialized key size
= -1, serialized value size = 102, key = null, value = [B@5b1b4ce3)
org.springframework.integration.transformer.MessageTransformationException:
Failed to transform Message; nested exception is
org.springframework.messaging.MessageHandlingException: nested
exception is
org.springframework.expression.spel.SpelEvaluationException: EL1004E:
Method call: Method getValue(java.lang.String) cannot be found on
java.lang.String type, failedMessage=GenericMessage
[payload={"name":"world"}, headers={kafka_offset=0,
id=0392ca58-6644-91fb-9454-a41e83854955, kafka_receivedPartitionId=0,
contentType=application/json;charset=UTF-8,
kafka_receivedTopic=http_jdbc04.http, timestamp=1505563317552}]
这是我关注的文档 spring-cloud-dataflow-docs
以及 Spring 云数据流版本:
1.spring云数据流本地服务器1.2.3.RELEASE
2.Java: 1.8.0
我解决了这个问题。
这行不通:
transform --expression=payload.getValue('name')
你应该使用 #jsonPath(payload, '<json path expression>')
.
全部
I 运行 spring 云数据流与本地 server.when i 运行 定义如下的流
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 ERROR -kafka-listener-1 o.s.k.l.LoggingErrorHandler:37 - Error while processing: ConsumerRecord(topic = http_jdbc04.http, partition = 0, offset = 0, CreateTime = 1505563314419, checksum = 1043955671, serialized key size = -1, serialized value size = 102, key = null, value = [B@5b1b4ce3) org.springframework.integration.transformer.MessageTransformationException: Failed to transform Message; nested exception is org.springframework.messaging.MessageHandlingException: nested exception is org.springframework.expression.spel.SpelEvaluationException: EL1004E: Method call: Method getValue(java.lang.String) cannot be found on java.lang.String type, failedMessage=GenericMessage [payload={"name":"world"}, headers={kafka_offset=0, id=0392ca58-6644-91fb-9454-a41e83854955, kafka_receivedPartitionId=0, contentType=application/json;charset=UTF-8, kafka_receivedTopic=http_jdbc04.http, timestamp=1505563317552}]
这是我关注的文档 spring-cloud-dataflow-docs
以及 Spring 云数据流版本:
1.spring云数据流本地服务器1.2.3.RELEASE
2.Java: 1.8.0
我解决了这个问题。
这行不通:
transform --expression=payload.getValue('name')
你应该使用 #jsonPath(payload, '<json path expression>')
.