# 2nd Level cache in Hibernate 5.4.27 Final

**URL:** <https://discourse.hibernate.org/t/2nd-level-cache-in-hibernate-5-4-27-final/5118>\
**Category:** Hibernate ORM\
**Created:** [February 26, 2021, 11:20am UTC](https://discourse.hibernate.org/t/2nd-level-cache-in-hibernate-5-4-27-final/5118 "2021-02-26T11:20:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Souvik\_Dasgupta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/souvik_dasgupta/32/1393_2.png) [@Souvik\_Dasgupta](https://discourse.hibernate.org/u/Souvik_Dasgupta)\
**Post date:** [February 26, 2021, 11:20am UTC](https://discourse.hibernate.org/t/2nd-level-cache-in-hibernate-5-4-27-final/5118/1 "2021-02-26T11:20:35Z")

</div>

While I start my app I get the below message for ehCache implementation:  
**the ehcache second-level cache provider for hibernate is deprecated**

I have put below lines in hibernate.cfg.xml :

````auto
  <property name="hibernate.cache.use_second_level_cache">true</property>
    <property name="hibernate.cache.region.factory_class">org.hibernate.cache.jcache.JCacheRegionFactory</property>
    <property name="hibernate.javax.cache.provider">org.ehcache.jsr107.EhcacheCachingProvider</property>``` 

Also, have below entries in gradle : 

````

| | | | compile ‘org.hibernate:hibernate-jcache:5.4.27.Final@jar’ |
| --- | --- | --- | --- |
| | | | compile ‘org.ehcache:ehcache:3.9.2@jar’ |
| | | | compile ‘org.ehcache.modules:ehcache-107:3.9.2@jar’ |

```auto
Now I am getting below error at runtime:
**java.lang.NoClassDefFoundError: javax/cache/configuration/Configuration**

Please help.
```

---

<div class="post-metadata">

**Author:** ![beikov](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/beikov/32/258_2.png) [@beikov](https://discourse.hibernate.org/u/beikov)\
**Post date:** [March 1, 2021, 9:28am UTC](https://discourse.hibernate.org/t/2nd-level-cache-in-hibernate-5-4-27-final/5118/2 "2021-03-01T09:28:12Z")

</div>

You seem to be missing a JCache API dependency, but you should better ask this in the ehcache community.
