Error creating bean with name 'staffDao' defined in ServletContext
resource [/WEB-INF/classes/applicationContext.xml]: Instantiation
of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not
instantiate bean class [com.dzj.dao.impl.StaffDaoImpl]: Constructor
threw exception; nested exception is
java.lang.ExceptionInInitializerError
这个错误主要是因为applicationContext中的
sessionFactory">
红色标记的地方把它写成了大写,跟StaffDaoImpl中的变量名不一致了
本文探讨了在Spring框架中创建名为'staffDao'的Bean时遇到的问题,具体表现为因配置文件applicationContext.xml中SessionFactory配置项大小写不一致导致的实例化失败。通过修正配置项名称的大小写,成功解决了此问题。

被折叠的 条评论
为什么被折叠?



