I'm trying to migrate a big project from Appfuse 2.1 to 3.0.0. I've created a new clean project based on 3.0.0 basic Struts2 Archetype and I'm importing and adapting the old code. I'm having issue with the persistent layer that I've tracked down to EHCache version: as a dependency of appfuse-web module, the version of EHCache used is 2.2.6 (ehcache-core), but the configuration of the Hibernate session in applicationContext-dao.xml in appfuse-hibernate module is still in the form of EHCache 1.5. I've added to the project a model with annotations, a dao for this model, and a dao test I'm attaching to this issue. when I try to run the test, I'm getting this error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.optimalab.dao.CategoriaDaoTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.optimalab.dao.CategoriaDao com.optimalab.dao.CategoriaDaoTest.categoriaDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'categoriaDao': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext-dao.xml]: Invocation of init method failed; nested exception is org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).
This line in applicationContext-dao.xml: <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop>
should be replaced with: <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
I've added this in my applicationContext-dao.xml, trying to re-define the hibernate session. This solves the problem in my tests, but the appfuse tests still fails