Error creating bean with name 'sessionFactory' defined

created at 07-05-2021 views: 93


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 to develop the project, this error was reported when starting the service with tomcat. After carefully verifying the corresponding package and class mapping, the startup still reported an error.


  1. If it is an imported project, first reconfigure all Configure build path dependencies, including jdk, junit, tomcat, etc.
  2. Make sure all jar packages are ok, try maven install.
  3. Clear all tomcat caches, it is most likely a cache problem.
  4. Update the project and rerun it.

The solution this time is to clear the cache.

created at:07-05-2021
edited at: 07-05-2021: