Jboss Cache configuration with Seam 2.2 and Jboss 5.1
petitefl3ur.petitefl3ur.gmail.com Nov 14, 2009 12:13 PMHi,
I'm trying to configure JBossCache to run on JBoss 5.1 with Seam 2.2.
I have checked the documentation, and the examples in seam package but its seems that nothing happens with my configuration...
So i have had usefull jar in my ear lib: jboss-cache.jar, and jgroups.jar (jar i have found in the seam distribution)
i have created a treecache.xml with the same file i found in the seam distribution :
<classpath codebase=".." archives="jbosscache.jar, jgroups.jar"/>
and referenced it in the componenent.xml :
<cache:jboss-cache2-provider configuration="META-INF/treecache.xml" />
so i have this trace :
11:12:44,679 INFO [SettingsFactory] JPA-QL strict compliance: enabled 11:12:44,679 INFO [SettingsFactory] Second-level cache: enabled 11:12:44,679 INFO [SettingsFactory] Query cache: enabled 11:12:44,679 INFO [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge 11:12:44,680 INFO [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider 11:12:44,680 INFO [SettingsFactory] Optimize cache for minimal puts: disabled 11:12:44,680 INFO [SettingsFactory] Cache region prefix: persistence.unit:unitName=test-ear.ear/test-ejb.jar#test 11:12:44,680 INFO [SettingsFactory] Structured second-level cache entries: disabled 11:12:44,680 INFO [SettingsFactory] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory 11:12:44,681 INFO [SettingsFactory] Echoing all SQL to stdout 11:12:44,681 INFO [SettingsFactory] Statistics: disabled 11:12:44,681 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled 11:12:44,681 INFO [SettingsFactory] Default entity-mode: pojo 11:12:44,681 INFO [SettingsFactory] Named query checking : enabled 11:12:44,729 INFO [Version] Hibernate Search 3.0.1.SNAPSHOT-20080202 11:12:44,935 INFO [SessionFactoryImpl] building session factory 11:12:44,970 WARN [EntityRegionAdapter] read-only cache configured for mutable entity [persistence.unit:unitName=test-ear.ear/test-ejb.jar#test.com.entity.seed.TypeSeed]
But when i tried to do in a EBJ a injection like that :
@In JbossCache2Provider cacheProvider;
the component can't be created...
So in examples its seems that we have nothing to do in the persistence.xml but i find on some documentation where persistence.xml should look like that :
<property name="hibernate.cache.use_second_level_cache" value="true" /> <property name="hibernate.cache.use_query_cache" value="true" /> <property name="hibernate.cache.region.jbc2.query.localonly" value="true" /> <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory" /> <property name="hibernate.cache.use_query_cache" value="true" />
But this configuration file doesn't work because of a classpath problem :
Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory
So i have some questions:
Should the jar be in the jboss lib/ too? Are they too old (jboss cache 1.4) but then where can i find jbosscache 2.x or more ? jbosscache and jbosscache-core are same libs?
In the second case persistence.xml file with some new properties add, why the jar jboss-cache.jar, and jgroups.jar are not add in my classpath?
Have you some lead for me?
Thx!