1 Reply Latest reply on Jul 1, 2016 6:06 AM by Rony John

    Error on hibernate(5.1.0.Final) infinispan application

    Rony John Newbie

      Following error I am getting in a sample Jpa hibernate application with L2 cache as Infinispan(hibernate version as 5.1.0.Final).

       

       

        Exception in thread "main" java.util.ServiceConfigurationError: org.hibernate.boot.registry.selector.StrategyRegistrationProvider: Provider org.hibernate.cache.infinispan.StrategyRegistrationProviderImpl not found
      at java.util.ServiceLoader.fail(ServiceLoader.java:231)
      at java.util.ServiceLoader.access$300(ServiceLoader.java:181)
      at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365)
      at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
      at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.loadJavaServices(ClassLoaderServiceImpl.java:340)
      at org.hibernate.boot.registry.selector.internal.StrategySelectorBuilder.buildSelector(StrategySelectorBuilder.java:162)
      at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:222)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.buildBootstrapServiceRegistry(EntityManagerFactoryBuilderImpl.java:366)
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.<init>(EntityManagerFactoryBuilderImpl.java:167)
      at org.hibernate.jpa.boot.spi.Bootstrap.getEntityManagerFactoryBuilder(Bootstrap.java:34)
      at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilder(HibernatePersistenceProvider.java:165)
      at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:114)
      at org.hibernate.jpa.HibernatePersistenceProvider.getEntityManagerFactoryBuilderOrNull(HibernatePersistenceProvider.java:71)
      at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:52)
      at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)


      persistence.xml:-

      <persistence-unit name="EmployeeService">
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
        <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>
        <properties>
        
         <property name="hibernate.cache.use_second_level_cache"
          value="true" />
         <property name="hibernate.cache.region.factory_class"
          value="org.hibernate.cache.infinispan.InfinispanRegionFactory" />
        </properties>
      </persistence-unit>