2 Replies Latest reply on Oct 13, 2008 5:28 PM by a045103

    JBoss Cache 2.x with Hibernate 3.3

    a045103

      I recently attempted to integrate JBoss Cache 2.x as a second level cache with Hibernate 3.3.0 SP1. According to the Hibernate documentation I should be able to specify the org.hibernate.cache.jbc2.JBossCacheRegionFactory class as the provider class via the hibernate.cache.provider_class configuration property.

      At runtime, this generates an exception, as the JBossCacheRegionFactoryclass does not implement the CacheProvider class.

      If any reader of this forum has insight into how to configure a JBoss Cache 2.x (or higher) as a second level cache for Hibernate, I'd definitely appreciate it. Based on my limited exposure to this I don't see how this can work, at least using standard Hibernate second level cache configuration.



      Thanks.

      -Doug

      Caused by: org.hibernate.cache.CacheException: could not instantiate CacheProvider [org.hibernate.cache.jbc2.JBossCacheRegionFactory]
       at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:66)
       ... 81 more
      Caused by: java.lang.ClassCastException: org.hibernate.cache.jbc2.JBossCacheRegionFactory incompatible with org.hibernate.cache.CacheProvider
       at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)
       ... 81 more