【问题标题】:DateTimeFormatter in Mule DataMapperMule DataMapper 中的 DateTimeFormatter
【发布时间】:2014-10-15 05:38:40
【问题描述】:

我在 Mule 的 DataMapper 脚本中使用数据格式转换。

dateTimeFormatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

output.Date_of_Rate_Float__c = (isnull(input.Date_of_Rate_Float) ? null : dateTimeFormatter.format(input.Date_of_Rate_Float));

当我尝试保存映射时。我遇到了错误

Root Exception stack trace:
org.apache.commons.beanutils.ConversionException: DateConverter does not support default String to 'Date' conversion.
at org.apache.commons.beanutils.converters.DateTimeConverter.toDate(DateTimeConverter.java:468)

但是当我删除 dateTimeFormatter 时,我没有收到任何错误。我需要使用日期转换,有没有其他方法可以解决这个问题。

提前致谢。

【问题讨论】:

    标签: mule mule-studio mule-el mule-component


    【解决方案1】:

    您将 Date 数据类型保留为 string 并尝试格式化日期。将 Date 日期类型更改为 DATETIME 并进行转换。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-30
      • 1970-01-01
      • 2015-05-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多