Java教程

org.springframework.beans.FatalBeanException: Could not copy property 'commentCounts' from

本文主要是介绍org.springframework.beans.FatalBeanException: Could not copy property 'commentCounts' from,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

今天在写项目的时候遇到这个异常:

    org.springframework.beans.FatalBeanException: Could not copy property 'commentCounts' from source to target; nested exception is java.lang.IllegalArgumentException

贴上错误代码图

  

 

 让我感到异常烦恼,检查了service层代码,主要是通过BeanUtils的copyProperties将这个对象里的属性复制到另一个对象的属性。我这是使用了Vo层进行元素的封装。后面发现主要是pojo层的对象属性使用的是包装类Integer,而被复制的对象使用的是int。所以导致复制不过去,从而报错。


                    
这篇关于org.springframework.beans.FatalBeanException: Could not copy property 'commentCounts' from的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!