在一个JBoss上从java.lang.String类型转换为java.util.Date类型失败,但在另一个JBoss



我们已经在Websphere 7&8和Jboss EAP6上测试了当前的Spring应用程序

有趣的是,这个应用程序在一个Jboss服务器上工作得很好,但是在另一个Jboss服务器上会抛出异常,这两个服务器都是eap 6
org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'masterOrderForm' on field 'orderDate': rejected value [Mon May 27 12:27:20 ART 2013]; codes [typeMismatch.masterOrderForm.orderDate,typeMismatch.orderDate,typeMismatch.java.util.Date,typeMismatch]; 
arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [masterOrderForm.orderDate,orderDate]; arguments []; default message [orderDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'orderDate'; 
nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value 'Mon May 27 12:27:20 ART 2013'; nested exception is java.lang.IllegalArgumentException: Invalid format: "Mon May 27 12:27:20 ART 2013"]
org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'masterOrderForm' on field 'orderDate': rejected value [Mon May 27 12:27:20 ART 2013]; codes [typeMismatch.masterOrderForm.orderDate,typeMismatch.orderDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [masterOrderForm.orderDate,orderDate]; arguments []; default message [orderDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'orderDate'; 
nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type java.util.Date for value 'Mon May 27 12:27:20 ART 2013'; nested exception is java.lang.IllegalArgumentException: Invalid format: "Mon May 27 12:27:20 ART 2013"]

从UI中,Jboss服务器日期字段的格式为"ddmmyyyy",但它只是在一个服务器上抛出异常,但在另一个服务器上却像魅力一样工作

这是我们可以从服务器端配置来克服的吗?

我在谷歌上搜索了这个错误,找到了这个链接。

如果在代码上没有问题,可能jvm正在使用不同的语言环境配置运行

最新更新