1. Error messages
Invocation of Init method failed; Nested exception is org.hibernate.mappingnotfoundexception:resource:model/department.hbm.xml not found
At
2. Error analysis
(1) The project's Hibernate reverse engineering is done using IntelliJ's persistant tool, and the model objects and mapping files are saved in the catalog after the final completion.
(2) Since we have set the SRC folder to hold the code, the resource folder is a resource, so IntelliJ will ignore the XML file under the SRC folder at compile time, resulting in the loss of these mapping files under the last folder being published.
For details, refer to: http://stackoverflow.com/questions/2843949/ How-to-configure-hibernate-tools-with-maven-to-generate-hibernate-cfg-xml-hbm
3. Solution
Create a folder with the same name as the directory under the Resource directory, and save the appropriate XML file.
IntelliJ compilation Springmvc+hibernate+spring+maven Unable to find hbm.xml mapping file