Error creating bean with name ‘sessionFactory’ defined


Error creating bean with name ‘sessionFactory’ defined in class path resource [spring/applicationContext-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found:

Using SSH development project, this error is reported when starting the service with Tomcat. After carefully verifying the corresponding package and class mapping, the startup is still an error.

terms of settlement:

1. If it is an imported project, first reconfigure all the configure build path dependencies, including JDK, JUnit, Tomcat, etc.
2. Make sure all jar packages are OK and try Maven install.
3. Emptying all Tomcat caches is most likely a cache problem.
4. Update the project and run it again.

The solution this time is to empty the cache.