0 Replies Latest reply on Jul 30, 2013 6:53 AM by aspide1985

    EnversIntegrator JBoss AS 7.1.1.Final ClassCastException

    aspide1985 Newbie

      Hi,

       

      I'm using JBoss AS 7.1.1.Final and Hibernate Envers 4.2.3.Final with hibernate 4.2.3.final and spring 3.2.1.

      I've updated envers module in jboss from 4.1.0 version to 4.2.3 but during deploy I got this error:

       

       

       

      Caused by: java.util.ServiceConfigurationError: org.hibernate.integrator.spi.Integrator: Provider org.hibernate.envers.event.EnversIntegrator could not be instantiated: java.lang.ClassCastException
                at java.util.ServiceLoader.fail(ServiceLoader.java:207) [rt.jar:1.6.0_35]
                at java.util.ServiceLoader.access$100(ServiceLoader.java:164) [rt.jar:1.6.0_35]
                at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353) [rt.jar:1.6.0_35]
                at java.util.ServiceLoader$1.next(ServiceLoader.java:421) [rt.jar:1.6.0_35]
                at org.hibernate.service.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:236) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(IntegratorServiceImpl.java:53) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:80) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.hibernate.service.internal.BootstrapServiceRegistryImpl.<init>(BootstrapServiceRegistryImpl.java:57) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.hibernate.service.ServiceRegistryBuilder.<init>(ServiceRegistryBuilder.java:76) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1825) [hibernate-core-4.2.3.Final.jar:4.2.3.Final]
                at org.springframework.orm.hibernate4.LocalSessionFactoryBuilder.buildSessionFactory(LocalSessionFactoryBuilder.java:242) [spring-orm-3.2.1.RELEASE.jar:3.2.1.RELEASE]
                at org.springframework.orm.hibernate4.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:372) [spring-orm-3.2.1.RELEASE.jar:3.2.1.RELEASE]
                at org.springframework.orm.hibernate4.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:357) [spring-orm-3.2.1.RELEASE.jar:3.2.1.RELEASE]
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1545) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1483) [spring-beans-3.2.1.RELEASE.jar:3.2.1.RELEASE]
                ... 123 more
      Caused by: java.lang.ClassCastException
                at java.lang.Class.cast(Class.java:2990) [rt.jar:1.6.0_35]
                at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345) [rt.jar:1.6.0_35]
                ... 135 more
      
      

       

      I've read a tutorial http://www.warski.org/blog/2011/08/using-envers-with-as7/ and I have used his suggestion to add in manifest file Dependencies: org.hibernate.envers services!

       

      any suggestion?

       

      Regards, Jonathan