0

以下是数据映射器中的映射部分

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)); output.Loan_Create_Date__c = (isnull(input.loan_create_date) ? null : dateTimeFormatter.format(input.loan_create_date)); output.Estimated_Closing_Date__c = (isnull(input.estimated_closing_date) ? null : dateTimeFormatter.format(input.estimated_closing_date));

这会引发以下异常

1. DateConverter does not support default String to 'Date' conversion. (org.apache.commons.beanutils.ConversionException)
  org.apache.commons.beanutils.converters.DateTimeConverter:468 (null)

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)
    at org.apache.commons.beanutils.converters.DateTimeConverter.convertToType(DateTimeConverter.java:343)
    at org.apache.commons.beanutils.converters.AbstractConverter.convert(AbstractConverter.java:156)
    at org.apache.commons.beanutils.ConvertUtilsBean.convert(ConvertUtilsBean.java:544)
    at com.mulesoft.datamapper.transform.converter.ScalarValueConversion.convert(ScalarValueConversion.java:126)
    at com.mulesoft.datamapper.transform.DataRecordContext.put(DataRecordContext.java:87)
    at com.mulesoft.datamapper.transform.DataRecordContext.put(DataRecordContext.java:24)
    at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeSetAccessor(ReflectiveAccessorOptimizer.java:308)
    at org.mvel2.compiler.CompiledAccExpression.setValue(CompiledAccExpression.java:54)
    at org.mvel2.ast.DeepAssignmentNode.getReducedValueAccelerated(DeepAssignmentNode.java:92)
    at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
    at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
    at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113)
    at org.mvel2.MVEL.executeExpression(MVEL.java:942)
    at org.mule.el.mvel.MVELExpressionExecutor.execute(MVELExpressionExecutor.java:50)
    at com.mulesoft.datamapper.transform.DataMapperExpressionLanguage.evaluate(DataMapperExpressionLanguage.java:106)
    at com.mulesoft.datamapper.transform.MelRecordTransform.transform(MelRecordTransform.java:56)
    at org.jetel.component.Reformat.execute(Reformat.java:273)
    at org.jetel.graph.Node.run(Node.java:465)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

********************************************************************************

我无法找到导致此异常的原因,我想寻求帮助以解决此问题。

先感谢您

4

1 回答 1

0

看起来空值正在传递给该format方法。要了解如何使其“空安全”,您可以查看格式化日期中的示例,允许空

于 2014-10-13T03:35:23.733 回答