This content has been marked as final.
Show 1 reply
-
1. Re: Resolve "New missing/unsatisfied dependencies" error
grossetieg Jun 26, 2011 11:25 AM (in response to grossetieg)Ok I give a try at the latest SNAPSHOT available : jboss-7.0.0.Beta4-SNAPSHOT and it's working fine !
I can now enjoy really fast boot and fast deployment
For people who want to use cache with JBoss-7.0.0.Beta4, you can modify your persistence.xml to use Infinispan (instead of ehcache) :
<?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="my-ds" transaction-type="JTA"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>java:/MyDS</jta-data-source> <properties> <!-- Cache --> <property name="hibernate.cache.use_query_cache" value="true" /> <property name="hibernate.cache.use_second_level_cache" value="true" /> <!-- Inifinispan --> <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.TransactionManagerLookup"/> <property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.JndiInfinispanRegionFactory"/> <property name="hibernate.cache.infinispan.cachemanager" value="java:jboss/infinispan/hibernate"/> <property name="hibernate.cache.infinispan.statistics" value="true"/> </properties> </persistence-unit> </persistence>
In fact even the latest SNAPSHOT available ehcahe-core-2.5.0 is incompatible with hibernate-core-4.0.0.Beta1.jar.
The following import statements are problematic (throw ClassNotFoundException) in net.sf.ehcache.hibernate.AbstractEhcacheRegionFactory :
import org.hibernate.cache.CacheDataDescription; import org.hibernate.cache.CacheException; import org.hibernate.cache.CollectionRegion; import org.hibernate.cache.EntityRegion; import org.hibernate.cache.QueryResultsRegion; import org.hibernate.cache.RegionFactory; import org.hibernate.cache.Timestamper; import org.hibernate.cache.TimestampsRegion; import org.hibernate.cache.access.AccessType; import org.hibernate.cfg.Settings;
Dont forget to modify CacheConcurrencyStrategy.NONSTRICT_READ_WRITE to CacheConcurrencyStrategy.TRANSACTIONAL to avoid CacheException :
Caused by: org.hibernate.cache.CacheException: unsupported access type [nonstrict-read-write]
Guillaume.