I’m migrating a legacy application with spring-orm-6.x with Hibernate 6.1.6.Final version. While running the application, the at new HibernateTemplate(session), following error is being thrown:
Caused by: java.lang.ClassNotFoundException: org.hibernate.criterion.Criterion at (BuiltinClassLoader.java:641) at (ClassLoaders.java:188) at (ClassLoader.java:520) … 158 more When tried to find this class, this looks to be removed from hibernate 6.x versions. As soon I downgrade to hibernate 5.x version this works fine and HibernateTemplate object gets created but I need to migrate to Hibernate 6.1.x version as this is the compatible version with spring framework 6.0.
I tried looking into build path related issues and removed all older versions but still issue persists.
2 Answers
Correct solution was to remove HibernateTemplate usage and use Session API instead in legacy code.
just use google and migrating instructions
2