I have a dependency defined in my pom.xml
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>3.3.0.ga</version> </dependency>
I have the above jar in C: /User/.m2/repository/org/hibernate/hibernate-commons-annotations/3.3.0.ga
I have a factory session and a data source configured in the hibernate.cfg.xml file, and when trying to create a configuration in my main method:
Configuration configuration = new Configuration().configure(); StandardServiceRegistryBuilder builder = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()); SessionFactory sessionFactory = configuration.buildSessionFactory(builder.build()); Session session = sessionFactory.openSession();
I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
I tried adding the hibernate-commons-annotion banner directly to my build path, as well as my WEB-INF / lib, but so far failed
This is configured in the same way and works properly in another application that I created that does not need to import the annotation bank. Any ideas?
source share