这个问题,我找了平台上的方法,但都没有一个能够解决我问题的答案。
如:
https://blog.csdn.net/weixin_42054155/article/details/82117517
https://blog.csdn.net/Tink_bell/article/details/88828275
这两位博主的答案,都没有是使我解决问题。
于是我意识到,一味的搜索答案固然能找到正确答案,但所花费的时间精力远远不值得这么做,因为以后编写的程序一定会有bug的出现,所以还得回去找错误,去debug调试。
以本人为例,在Console中出现的报错(一般报错的提醒会在第一个出现错误的地方提醒的如图1-1)
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'sessionFactory' defined in file
[F:\MES_课程大作业\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
\Test2_SSH\WEB-INF\classes\applicationContext.xml]:
Invocation of init method failed; nested exception is
org.hibernate.boot.InvalidMappingException:
Could not parse mapping document: entity/User.hbm.xml (RESOURCE)
图1-1
具体的提示的报错的文件提示为末尾的:Could not parse mapping document: entity/User.hbm.xml (RESOURCE)
于是我去检查了这个entity/User.hbm.xml文件,发现了有个数据库的表调用错误导致的。
还是大佬的那句话,具体问题具体分析!