I\'m getting a bizarre Hibernate exception that I can\'t explain. It\'s telling me that I\'m using 2nd level cache, but no where in hibernate.cfg.xml
do I specify a
This error is very misleading, I spent almost a day to finally figure out the root cause. Thought my hibernate config file has defined second level cache and factory class, it was giving me error that hibernate.cache.region.factory_class is not given.
I see that by hibernate.cfg.xml file is also available in classpath. But even after any change in that there was no impact and getting same error.
Finally I realized that for test purpose I have overridden persistence.xml file which has below missing properties under persistence-unit. After adding that issue was resolved.
So this means my application was not able to find hibernate.cfg.xml file and somehow instead of giving error related to missing configuration, it cries out for factory class.