When I try to use Hibernate ogm and spring boot the console gives “Could not instantiate named strategy class” error

别来无恙 提交于 2019-12-02 12:38:35

The version of OGM you are using (4.0.0.Beta4) is way too old considering the version of Hibernate ORM you are using (5.0.11.Final). You should use compatible versions, because OGM depends on Hibernate ORM.

If you want to use ORM 5.0.11.Final, then you should use OGM 5.0.4.Final. I would recommend upgrading to more recent versions, though; 5.0 is already one year and a half old and several versions have been published since it was first released.

Be careful though, the version number of OGM generally does not match the version number of ORM. For compatibility of more recent versions of OGM with ORM, see http://hibernate.org/ogm/releases/#compatibility-matrix.

I don't use Spring Boot but JBoss WildFly 11/12 with MongoDB. I had problems getting started. By ensuring I was using the latest version of Hibernate, OGM & Elastic Search etc. fixed it for me.

From your log:

Caused by: java.lang.NoSuchMethodException: org.hibernate.ogm.datastore.mongodb.MongoDBDialect.()

Shows mismatch of version numbers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!