I want to use Infinispan with hibernate second level cache. My application is running in a glassfish 3 application server and I use hibernate JPA. The hibernate library already contains infinispan so I didn’t added to my project.
I use jta transaction. To do that I modify my persistence.xml:
<!-- Infinispan second level cache configuration -->
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.infinispan.InfinispanRegionFactory"/>
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
When I redeploy the application I get the following exception:
java.lang.NoClassDefFoundError: org/infinispan/transaction/lookup/TransactionManagerLookup
Should I try to add the infinispan library to the project?
I tried to set:
<property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.JTATransactionFactory"/>
but didn’t worked.
Thanks in advance.
Ok, my fault.
I made an user library and put it all of the necessary jars. In eclipse I added to the project build path but I forgot to copy the library to the glassfish lib. To do that open the project build path again, select Deployment Assembly and add the user library to Deploy Path.
After everything should be fine.