1

I'm following the guidelines on the latest infispan 11.0 doc

So I did:

  1. Installed infinispan libraries under wildfly modules directory

  2. Added dependencies on pom.xml

     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-core</artifactId>
         <version>${version.infinispan}</version>
         <scope>provided</scope>
     </dependency>
    
     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cachestore-jdbc</artifactId>
         <version>${version.infinispan}</version>
         <scope>provided</scope>
     </dependency>
    
     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-cdi-embedded</artifactId>
         <version>${version.infinispan}</version>
         <scope>provided</scope>
     </dependency>
    
     <dependency>
         <groupId>org.infinispan</groupId>
         <artifactId>infinispan-jcache</artifactId>
         <version>${version.infinispan}</version>
         <scope>provided</scope>
     </dependency>
    
     <dependency>
         <groupId>javax.cache</groupId>
         <artifactId>cache-api</artifactId>
         <version>1.1.0</version>
     </dependency>
    

...

    <plugins>
        <!--Configure the EJB plugin: we create EJB 3.2. If not specified, an error will arise because the plugin expects an Ejb-jar by default. -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ejb-plugin</artifactId>
            <version>${version.ejb.plugin}</version>
            <configuration>
                <!-- Tell Maven we are using EJB 3.2 -->
                <ejbVersion>3.2</ejbVersion>
                <archive>
                    <manifestEntries>
                        <Dependencies>org.infinispan:ispn-11.0 services</Dependencies>
                    </manifestEntries>
                </archive>
            </configuration>
        </plugin>

I tried to use @CacheResult annotation on a service method, but all I got is this error:

 javax.cache.CacheException: No CachingProviders have been configured

I guess I need to to add jcache libraries on manifest, but I'm not sure and neither I don't know how.

Any hints?

Fabrizio Stellato
  • 1,727
  • 21
  • 52

1 Answers1

1

A bit "late to the party", but I was facing a similar issue but seem to got it working by not only including the org.infinispan module, but also the modules org.infinispan.jcache and org.infinispan.cdi.embedded.

In addition, I ran into the issue described in JCache with Infinispan in Wildfly 14 generate Unsatisfied dependencies for type InfinispanExtensionEmbedded with qualifiers @Default (Unsatisfied dependencies for type InfinispanExtensionEmbedded), so I had to add the export keyword to the modules.

My complete classpath now looks like this:

org.infinispan:ispn-11.0 services export,org.infinispan.jcache:ispn-11.0 services export,org.infinispan.cdi.embedded:ispn-11.0 services export

Also, the following tutorial has been helpful for me: Sergii Kostenko's Blog: Distributed caching with Wildfly/Infinispan and poor JCache support

EDIT: It seems that this is definitely unsupported by JBoss EAP. So I would assume the same to be true for WildFly:

Important
Infinispan is delivered as a private module in JBoss EAP to provide the caching capabilities of JBoss EAP. Infinispan is not supported for direct use by applications.

Matthias
  • 12,053
  • 4
  • 49
  • 91