org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException

Hibernate JIRA | aditya shrivastava | 2 years ago
  1. 0

    Hi, I am using Hibernate 4.3.7 + Struts 2 + tomcat 7. I want to use EventListener Feature of Hibernate 4.3.7 For this I have tested the configuration with 2 project one is normal java project & other is dynamic web project. For Normal java project I created following struture: project src resources META-INF Services org.hibernate.integrator.spi.Integrator & in my [code] org.hibernate.integrator.spi.Integrator [/code] it contains Implementation class for EventListener Now for dynamic web project I created following Structure:- project src resources META-INF Services org.hibernate.integrator.spi.Integrator Web Content WEB-INF & I am initializing my Hibernate session factory from ServletContextListener one of them which I created for initializing resources. Now when start my tomcat server It gives me following error for Hibernate Session Factory Initialization [code]Error while initializing Hibernate Session factory,Reason : org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException at com.elitecore.nvsmx.policydesigner.model.HibernateSessionFactory.buildSessionFactory(HibernateSessionFactory.java:74) at com.elitecore.nvsmx.policydesigner.listeners.NVSMXContextInitializer.contextInitialized(NVSMXContextInitializer.java:68) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException at java.util.ServiceLoader.fail(ServiceLoader.java:207) at java.util.ServiceLoader.access$100(ServiceLoader.java:164) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353) at java.util.ServiceLoader$1.next(ServiceLoader.java:421) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:339) at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:57) at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:73) at com.elitecore.nvsmx.policydesigner.model.HibernateSessionFactory.buildSessionFactory(HibernateSessionFactory.java:59) ... 11 more Caused by: java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345) ... 17 more[/code] My question is :- (1). Whether my placement for [code]org.hibernate.integrator.spi.Integrator[/code] file is wrong. (2). Some configuration issue because My normal java project is working fine Thanks in Advance.....

    Hibernate JIRA | 2 years ago | aditya shrivastava
    org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException
  2. 0

    Hi, I am using Hibernate 4.3.7 + Struts 2 + tomcat 7. I want to use EventListener Feature of Hibernate 4.3.7 For this I have tested the configuration with 2 project one is normal java project & other is dynamic web project. For Normal java project I created following struture: project src resources META-INF Services org.hibernate.integrator.spi.Integrator & in my [code] org.hibernate.integrator.spi.Integrator [/code] it contains Implementation class for EventListener Now for dynamic web project I created following Structure:- project src resources META-INF Services org.hibernate.integrator.spi.Integrator Web Content WEB-INF & I am initializing my Hibernate session factory from ServletContextListener one of them which I created for initializing resources. Now when start my tomcat server It gives me following error for Hibernate Session Factory Initialization [code]Error while initializing Hibernate Session factory,Reason : org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException at com.elitecore.nvsmx.policydesigner.model.HibernateSessionFactory.buildSessionFactory(HibernateSessionFactory.java:74) at com.elitecore.nvsmx.policydesigner.listeners.NVSMXContextInitializer.contextInitialized(NVSMXContextInitializer.java:68) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4887) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5381) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException at java.util.ServiceLoader.fail(ServiceLoader.java:207) at java.util.ServiceLoader.access$100(ServiceLoader.java:164) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353) at java.util.ServiceLoader$1.next(ServiceLoader.java:421) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:339) at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:57) at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:247) at org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:73) at com.elitecore.nvsmx.policydesigner.model.HibernateSessionFactory.buildSessionFactory(HibernateSessionFactory.java:59) ... 11 more Caused by: java.lang.ClassCastException at java.lang.Class.cast(Class.java:2990) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345) ... 17 more[/code] My question is :- (1). Whether my placement for [code]org.hibernate.integrator.spi.Integrator[/code] file is wrong. (2). Some configuration issue because My normal java project is working fine Thanks in Advance.....

    Hibernate JIRA | 2 years ago | aditya shrivastava
    org.hibernate.integrator.spi.Integrator: Provider com.elitecore.nvsmx.policydesigner.listeners.PreInsertListeners could not be instantiated: java.lang.ClassCastException
  3. 0

    Maven Command jetty:run-war throwing ClassCastException : JuliLog to org.apache.juli.logging.Log

    Stack Overflow | 1 year ago | Nithin CV Poyyil
    java.lang.ClassCastException: Cannot cast org.eclipse.jetty.apache.jsp.JuliLog to org.apache.juli.logging.Log
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    ClassCastException : PortableRemoteObject.

    Oracle Community | 1 decade ago | 403765
    java.lang.ClassCastException

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      No message provided

      at java.lang.Class.cast()
    2. Java RT
      ServiceLoader$LazyIterator.next
      1. java.lang.Class.cast(Class.java:2990)
      2. java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
      2 frames