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

17-09-2018

this is like bullshit. the Datasourcepool has nothing common with hibernate, it just connect your application with the database.

Why is there no support for config hibernate with AEM CQ?

I think many companies would like to use hibernate with CQ.