1. 程式人生 > >關於org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]:Specified class is an interface

關於org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]:Specified class is an interface

exc img interface 類型 生成 lis final spring cif

技術分享圖片

報錯原因:

  spring在註入的時候不允許註入一個List類型的對象,才會導致報上訴錯誤;

解決辦法:

  ①:改變為數組方式去接收;(我沒用)

  ②:再把這個“List<WorkFinalStatmentVo> statmentVoList” 封裝成一個對象------->StatmentVoList statmentVoList,生成get,set方法,將對象註入;

  ③:。。。或許還有其他的辦法解決,有的話請大神賜教!

關於org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]:Specified class is an interface