-1
java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.<init>(Lorg/hibernate/boot/spi/MetadataBuildingOptions;)V

while connection to hibernate connection I am getting such type of error.

Spartan
  • 23
  • 7
  • Welcome to stack overflow. Please read https://stackoverflow.com/help/how-to-ask and improve your question. – M. Deinum May 08 '17 at 12:35

1 Answers1

0

Copied the answer from here. In my case, there was conflict between following depdencies :

  1. Hibernate Annotations :

    <dependency>
     <groupId>org.hibernate</groupId>
     <artifactId>hibernate-annotations</artifactId>
     <version>3.5.6-Final</version>
    </dependency>
    
  2. Hibernate Commons Annotations :

    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
      <version>3.2.0.Final</version>
    </dependency>
    

I resolved the conflict by removing both the dependencies and using following one :

Hibernate Commons Annotations » 5.0.1.Final

     <dependency>
      <groupId>org.hibernate.common</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
      <version>5.0.1.Final</version>
     </dependency>

Hope this might help someone.

Community
  • 1
  • 1
Sudhakar
  • 3,104
  • 2
  • 27
  • 36