How to use hibernate in CQ6?

Avatar

Avatar

pradeepdubey82

Avatar

pradeepdubey82

pradeepdubey82

28-04-2016

Hi,

I am using hibernate 4.0.1 for CRUD operations upon page replication. For this i have written eventhandler, in handleEvent method i am writing logic to persist page property in database using hibernate.

I am getting class not found error in hibernate. added all dependencies in POM file, showing all jars in classpath too, bundle is deployed successfully and it is in active state. 

hibernate.cfg.xml i have put in src/main/resources folder and added this folder in classpath.

java.lang.NoClassDefFoundError: org/hibernate/cfg/Configuration

Could anyone please help me to resolve the issue, below piece of code is causing the problem 

Configuration configuration = new Configuration().configure();
            ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(
                    configuration.getProperties()). buildServiceRegistry();
            SessionFactory sessionFactory = configuration.buildSessionFactory(serviceRegistry);
            Session session = sessionFactory.openSession();

 

Thanks,

Pradeep

View Entire Topic

Avatar

Avatar

fabianh12876403

Avatar

fabianh12876403

fabianh12876403

24-09-2018

Ok so to build a complex database diagram I have to work like in 1950?

Or is there any other possibility for complex datastructures? With a lot of dependencies between the tables, and a lot of attributes, to generate them automatically?