You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Kleber Ayala <kl...@gmail.com> on 2019/05/08 20:52:22 UTC

Karaf 4.2.5 - Hibernate 5.4.2 Second level cache with JCache-Ehcache 3

Hi Karaf users.

Is there any way to use 2L cache with karaf / hibernate 5.4.2 / Ehcache 3/ Jcache?

I´m trying to enable 2l cache but no luck, I'm not sure it is a misconfiguration or a bug on hibernate-osgi or karaf.

Hibernate 5.4.2
Karaf 4.2.5
Ehcache 3
Jcache


The application works fine if hibernate.cache.use_second_level_cache is false, 

but when is true there is. an:  java.lang.ClassNotFoundException: org.ehcache.jsr107.EhcacheCachingProvider

If I use 2l cache with Ehcache 2 works, but with some warnings  suggesting to use Ehcache 3/jcache.



A simple "hello world” project with more details to reproduce the issue is on https://github.com/klebeer/karaf-hibernate2Lcache-bug <https://github.com/klebeer/karaf-hibernate2Lcache-bug>

Thanks


Re: Karaf 4.2.5 - Hibernate 5.4.2 Second level cache with JCache-Ehcache 3

Posted by LuisLo <he...@gmail.com>.
I have the same problem in version 4.2.6
Would you be so kind as to put the solution here if you finally find it? I
will do the same.
I have tried ehcache and infinispan, but I always get the same result.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html

Re: Karaf 4.2.5 - Hibernate 5.4.2 Second level cache with JCache-Ehcache 3

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Kleber,

never use 2l cache. Let me try to reproduce. Maybe a missing import in
hibernate osgi for ehcache packages.

Regards
JB

On 08/05/2019 22:52, Kleber Ayala wrote:
> Hi Karaf users.
> 
> Is there any way to use 2L cache with karaf / hibernate 5.4.2 / Ehcache
> 3/ Jcache?
> 
> I´m trying to enable 2l cache but no luck, I'm not sure it is a
> misconfiguration or a bug on hibernate-osgi or karaf.
> 
> Hibernate 5.4.2
> Karaf 4.2.5
> Ehcache 3
> Jcache
> 
> 
> The application works fine if hibernate.cache.use_second_level_cache is
> false, 
> 
> but when is true there is. an:  java.lang.ClassNotFoundException:
> org.ehcache.jsr107.EhcacheCachingProvider
> 
> If I use 2l cache with Ehcache 2 works, but with some warnings
>  suggesting to use Ehcache 3/jcache.
> 
> 
> 
> A simple "hello world” project with more details to reproduce the issue
> is on https://github.com/klebeer/karaf-hibernate2Lcache-bug
> 
> Thanks
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com