java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session

后端 未结 4 2049
旧时难觅i
旧时难觅i 2020-11-29 07:24

i am trying to integrate my already working spring project with hibernate, but this is the error i am getting on start up.

EVERE: Servlet.service() for servl         


        
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 08:17

    This error is caused by transitive dependency of maven managed projects. Child will be using a particular version of an artefact but the parent would fetch a later version. In my case, I had to use

    
        
            org.hibernate
            hibernate-core
            4.3.11.Final
        
    
    

    In the parent pom (i.e, I have specified the dependency version again in parent pom) to avoid this conflict.

提交回复
热议问题