0 Replies Latest reply on Jun 30, 2016 6:10 AM by Sumeeth Tewar

    Unable to load my hibernate listeners

    Sumeeth Tewar Newbie

      I have installed WildFly 10,

      I have configured my library in the jboss modules format and added a jboss-deployment-structure.xml to my war which includes dependencies on my library and hibernate.

      deployed it with the following exception :

      2016-06-30 15:13:23,141 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 22) MSC000001: Failed to start service jboss.persistenceunit."SMGRPersistence.jar#SMGRPersistenceUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."SMGRPersistence.jar#SMGRPersistenceUnit": javax.persistence.PersistenceException: [PersistenceUnit: SMGRPersistenceUnit] Unable to build Hibernate SessionFactory

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:172)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:117)

              at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:667)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:182)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at java.lang.Thread.run(Thread.java:745)

              at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: SMGRPersistenceUnit] Unable to build Hibernate SessionFactory

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.persistenceException(EntityManagerFactoryBuilderImpl.java:954)

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:882)

              at org.jboss.as.jpa.hibernate5.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154)

              ... 7 more

      Caused by: org.hibernate.HibernateException: Could not instantiate requested listener [com.personal.coreservice.persistence.CimPreFlushEntityEventListener,           org.hibernate.ejb.event.EJB3FlushEntityEventListener,            com.personal.coreservice.persistence.CimPostFlushEntityEventListener]

              at org.hibernate.jpa.event.spi.JpaIntegrator.instantiate(JpaIntegrator.java:207)

              at org.hibernate.jpa.event.spi.JpaIntegrator.integrate(JpaIntegrator.java:120)

              at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:278)

              at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)

              at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:879)

              ... 9 more

      Caused by: org.hibernate.boot.registry.classloading.spi.ClassLoadingException: Unable to load class [com.personal.coreservice.persistence.CimPreFlushEntityEventListener,           org.hibernate.ejb.event.EJB3FlushEntityEventListener,            com.personal.coreservice.persistence.CimPostFlushEntityEventListener]

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:229)

              at org.hibernate.jpa.event.spi.JpaIntegrator.instantiate(JpaIntegrator.java:204)

              ... 13 more

      Caused by: java.lang.ClassNotFoundException: Could not load requested class : com.personal.coreservice.persistence.CimPreFlushEntityEventListener,           org.hibernate.ejb.event.EJB3FlushEntityEventListener,            com.personal.coreservice.persistence.CimPostFlushEntityEventListener

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl$AggregatedClassLoader.findClass(ClassLoaderServiceImpl.java:217)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

              at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

              at java.lang.Class.forName0(Native Method)

              at java.lang.Class.forName(Class.java:348)

              at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.classForName(ClassLoaderServiceImpl.java:226)

       

       

      please note the "com.personal.coreservice.persistence.CimPreFlushEntityEventListener" etc classes are included in my library, and its added as an dependency.

      still it complains with ClassNotFoundException.

       

      Is the hibernate library not able to find my listener classes? If so How can I specify configuration to make hibernate libraries learn about the existence of my listeners?