title: JBossCache as a second level cache for Hibernate in JBoss 5
body: <p>Here is my configuration: Hibernate 3.3.1.GA, JBoss 5.1.0.GA, JBoss Cache 3.2.0.GA.</p>
  
  <p>I'm doing Hibernate configuration as described here:
  <a href="http://www.jboss.org/community/wiki/ClusteredJPAHibernateSecondLevelCachinginJBossAS5" rel="nofollow noreferrer">http://www.jboss.org/community/wiki/ClusteredJPAHibernateSecondLevelCachinginJBossAS5</a></p>
  
  <pre><code>&lt;hibernate-configuration&gt;
  
      &lt;session-factory&gt;
  
           &lt;property name="cache.use_second_level_cache"&gt;true&lt;/property&gt;
           &lt;property name="cache.use_query_cache"&gt;true&lt;/property&gt;
           &lt;property name="cache.region.factory_class"&gt;org.hibernate.cache.jbc2.JndiMultiplexedJBossCacheRegionFactoryctory&lt;/property&gt;
           &lt;property name="cache.region.jbc2.cachefactory&gt;java:CacheManager&lt;/property&gt;
           &lt;property name="cache.region.jbc2.cfg.entity"&gt;mvcc-entity&lt;/property&gt;
           &lt;property name="cache.region.jbc2.cfg.query"&gt;local-query&lt;/property&gt;
           &lt;property name="cache.region_prefix"&gt;tempdb&lt;/property&gt;
  
           ... other non-caching related configuration
  
      &lt;/session-factory&gt;
  
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>but getting error that specified property is invalid:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: No such property cache for bean org.jboss.hibernate.jmx.Hibernate available [statisticsServiceName, beanName, defaultSchema, defaultCatalog, sessionFactoryName, querySubstitutions, secondLevelCacheEnabled, password, version, statGenerationEnabled, maxFetchDepth, username, useStructuredCacheEntriesEnabled, datasourceName, dirty, streamsForBinaryEnabled, getGeneratedKeysEnabled, hbm2ddlAuto, minimalPutsEnabled, instance, jdbcBatchSize, jdbcScrollableResultSetEnabled, cacheRegionFactoryClass, dialect, scanForMappingsEnabled, runningSince, cacheRegionPrefix, class, cacheProviderClass, sessionFactoryRunning, batchVersionedDataEnabled, harUrl, queryCacheEnabled, sessionFactoryInterceptor, deployedCacheManagerJndiName, showSqlEnabled, reflectionOptimizationEnabled, jdbcFetchSize, listenerInjector, sqlCommentsEnabled, deployedCacheJndiName, controller]
  </code></pre>
  
  <p>So, I can not use "cache.region.factory_class" property but only "cacheRegionFactoryClass" (which is shown in exception).</p>
  
  <p>I can not use any other properties like cache.region.* and thus can not configurate second level cache for my hibernate.</p>
  
  <p>Can anyone give me a link how to configurate JBoss Cache 3.2 with JBoss 5.1? I'm especially interested in JndiSharedJBossCacheRegionFactory and JndiMultiplexedJBossCacheRegionFactory.</p>