报错【org.springframework.validation.BeanPropertyBindingResult】
报错内容:org.springframework.validation.BeanPropertyBindingResult: 1 errors Field error in object 'price' on field 'endTime': rejected value [2018-07-31]; codes [typeMismatch.price.endTime,typeMismatch.endTime,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [price.endTime,endTime]; arguments []; default message [endTime]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'endTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@javax.persistence.Column java.util.Date] for value '2018-07-31'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [2018-07-31]]

SpringMvc配置时,默认将接受的时期格式化为yyyy-MM-dd HH:mm:ss。而因为使用的日期插件中就是年月日格式的。所以出现Spring转化Date转化失败的问题。
这里出现一个问题,希望以后的我知道怎么回事吧?在此期间我在配置中打了断点,但是只有在项目启动时进入的断点,但是在后来调用接口的时候并没有进入断点。这里有一个猜测。在Spring中,配置只有在项目启动的时候初始化了一遍,而之后在调用的时候哦不进入初始化配置的方法中。
解决问题的方法:既然是映射的过程中无法将Spring转化为Date,而又和总配置有关。并不想改总配置,于是我用HttpServletRequest直接取得参数。就不会出现问题。接受的参数直接就是Spring,需要自己转化为Date
报错【org.springframework.validation.BeanPropertyBindingResult】的更多相关文章
- Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误——SHH框架
SHH框架工程,Tomcat启动报错org.springframework.web.context.ContextLoaderListener类配置错误 1.查看配置文件web.xml中是否配置.or ...
- org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
最近在项目中发现如下异常: 六月 25, 2015 5:58:34 下午 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet ...
- applicationContext.xml报错org.springframework.orm.hibernate3.LocalSessionFactoryBean not found
applicationContext.xml报错org.springframework.orm.hibernate3.LocalSessionFactoryBean not found 解决办法: 1 ...
- tomcat报错org.springframework.web.context.ContextLoaderListener找不到
tomcat报错org.springframework.web.context.ContextLoaderListener找不到. 最后解决办法:将jar包copy到web-inf下面的lib中. 你 ...
- 【spring boot】使用注解@ConfigurationProperties读取配置文件时候 报错 org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'rocketmqAutoConfiguration': Unsatisfied dependenc
如题,配置文件如下: #注册中心配置 eureka: instance: instanceId: ${spring.application.name}:${random.int} hostname: ...
- Tomcat 启动时项目报错 org.springframework.beans.factory.BeanCreationException
事情是这样的,最近我们公司需要将开发环境和测试环境分开,所以就需要把所有的项目部署一套新的开发环境. 我们都是通过 Jenkins 进行部署的,先说一下两个环境的配置: 测试环境配置(旧):jdk1. ...
- Spring AOP 报错org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'XXXXXX' defined in class path resource..........
完整报错如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'befo ...
- SSM整合报错org.springframework.beans.factory.UnsatisfiedDependencyException
我解决的办法是把.m2仓库所有文件删除,重新maven project就可以了. 但是在做这一步之前,报错如下: ①org.springframework.beans.factory.Unsatisf ...
- tomcat启动报错:org.springframework.beans.factory.BeanCreationException
Web容器在启动时加载 spring 配置文件时解析xml失败常常引起容器启动失败.这次配置文件是 ibatis的sql脚本出了问题: Context initialization failed or ...
随机推荐
- POJ-3450 Corporate Identity (KMP+后缀数组)
Description Beside other services, ACM helps companies to clearly state their “corporate identity”, ...
- markdown首行缩进
首行缩进两个字符:(每个表示一个空格,连续使用两个即可) 半角的空格 全角的空格
- OCIEnvCreate 失败,返回代码为 -1,但错误消息文本不可用 问题处理
OCIEnvCreate 失败,返回代码为 -1,但错误消息文本不可用 问题处理如下: 解决方法一:更换连接方式 config 文件配置: <add name="MASTER_DB&q ...
- linux常用命令 print格式输出
格式化输出命令 printf '输出类型 输出格式' 输出内容 输出类型: %ns 输出字符串,n是数字指代输出的几个字符 %ni 输出整数,n是数字指代输出几个数字 %m.nf 输出浮点数.m和n是 ...
- Ubuntu系统建立交叉编译环境
飞凌 FET6818核心板 解压编译器: tar zxvf arm-cortex_a9_eabi-4.7-eglibc-2.18.tar.gz -C/opt 设置默认编译环境: vi /etc/pr ...
- _net之美 记录笔记
第一章: Valpoint vPoint1=new Valpoint(); Console.WriteLine(vPoint1.x); 1.=号左边ValPoint vPoint1,在线程上创建一个V ...
- Hibernate的增删改查(事务)
Hibernate的事务: 1. 设置事务隔离级别都是用 自己进行存储的 二进制 十进制 read uncommitted 读未提交 0001 1 rea ...
- Shell脚本 自动部署 SpringBoot 应用
公司项目使用了SpringBoot.开发的应用需要自动上传到服务器.虽然目前对热部署还没完全掌握.先使用shell简化一下部署吧. # 上传密钥 sshLoginKey=/f/MyFile/root. ...
- 运行go服务器后台挂起(不看调试信息)
cd程序目录,shell输入go run+项目,接着键盘组合输入CTRL+Z,后台挂起进程. 要结束服务器,则输入fg,查看被挂起的go服务器进程,接着键盘组合输入CTRL+C,中断服务器进程. 此外 ...
- Ubuntu16.04下安装OpenCV3.2.0
1.安装官方给的opencv依赖包 $ sudo apt-get install build-essential $ sudo apt-get install cmake git libgtk2.0- ...