美文网首页
【SpringBoot】Cannot determine val

【SpringBoot】Cannot determine val

作者: DASH_1024 | 来源:发表于2019-10-10 11:25 被阅读0次

开发SpringBoot过程中程序发生异常,提示“Cannot determine value type from string 'xxx' with root cause”错误,根据Log显示数据格式错误,试了修改数据格式,没用,在此记录解决办法。

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.dao.DataIntegrityViolationException: Error attempting to get column 'name' from result set.  Cause: java.sql.SQLDataException: Cannot determine value type from string 'xiaoming'
; Cannot determine value type from string 'xiaoming'; nested exception is java.sql.SQLDataException: Cannot determine value type from string 'xiaoming'] with root cause

com.mysql.cj.exceptions.DataConversionException: Cannot determine value type from string 'xiaoming'

解决办法:这种情况出现还可能是实体类实现有参构造函数后,没有写无参构造函数,添加无参构造函数即可。

//无参构造函数
public UserBean() {
        
}

public UserBean(String name, int age) {
    this.name = name;
    this.age = age;
}

相关文章

网友评论

      本文标题:【SpringBoot】Cannot determine val

      本文链接:https://www.haomeiwen.com/subject/sksopctx.html