You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Narahari Lakshminarayana <it...@gmail.com> on 2020/11/27 23:34:58 UTC

Why would this not work ? - No CachingProviders have been configured

Friends:

I have the following code that is not working.

@Grapes(
    @Grab(group='org.mnode.ical4j', module='ical4j', version='3.0.20')
)
@Grapes(
    @Grab(group='javax.cache', module='cache-api', version='1.1.1')
)
@Grapes(
    @Grab(group='com.github.ben-manes.caffeine', module='caffeine',
version='2.8.6')
)

import javax.cache.spi.*;
import javax.cache.*;
import javax.cache.configuration.*;
import com.github.benmanes.caffeine.*;

CachingProvider cachingProvider = Caching.getCachingProvider();

I get the following error

javax.cache.CacheException: No CachingProviders have been configured

===================

Not sure what is wrong in the above code.

Please help.

-Narahari

Re: Why would this not work ? - No CachingProviders have been configured

Posted by Simon Tost <Si...@tngtech.com>.
Hi Narahari,


I cannot speak with authority, but maybe you also want to load the
jcache api dependency of caffeine as well.
("@Grab(group='com.github.ben-manes.caffeine', module='jcache',
version='2.8.6')") [1]

And peeking at one of their test cases, you may need a call it like:
Caching.getCachingProvider(CaffeineCachingProvider.class.name)
[2]

But I did not test this.


Hope it helps,
Simon


PS: This is not really a question specific to Groovy. Maybe a place like
https://stackoverflow.com/ is more appropriate for general Java questions.



[1] See https://github.com/ben-manes/caffeine at the bottom
[2]
https://github.com/ben-manes/caffeine/blob/master/jcache/src/test/java/com/github/benmanes/caffeine/jcache/CacheManagerTest.java






On 28.11.20 00:34, Narahari Lakshminarayana wrote:
> Friends:
>
> I have the following code that is not working.
>
> @Grapes(
>     @Grab(group='org.mnode.ical4j', module='ical4j', version='3.0.20')
> )
> @Grapes(
>     @Grab(group='javax.cache', module='cache-api', version='1.1.1')
> )
> @Grapes(
>     @Grab(group='com.github.ben-manes.caffeine', module='caffeine',
> version='2.8.6')
> )
>
> import javax.cache.spi.*;
> import javax.cache.*;
> import javax.cache.configuration.*;
> import com.github.benmanes.caffeine.*;
>
> CachingProvider cachingProvider = Caching.getCachingProvider();
>
> I get the following error
>
> javax.cache.CacheException: No CachingProviders have been configured
>
> ===================
>
> Not sure what is wrong in the above code.
>
> Please help.
>
> -Narahari
>
>


-- 
Simon Tost * simon.tost@tngtech.com * +49-176-17654629
TNG Technology Consulting GmbH, Beta-Str. 13a, 85774 Unterföhring
Geschäftsführer: Henrik Klagges, Gerhard Müller, Dr. Robert Dahlke
Sitz: Unterföhring * Amtsgericht München * HRB 135082