[infinispan-dev] Obtaining cache via CDI on WildFly

Gunnar Morling gunnar at hibernate.org
Wed Dec 5 03:44:49 EST 2018


Hey,

I was trying to configure and inject an Infinispan cache through CDI,
running on WildFly 14, using the Infinispan modules provided by the
server.

While I'm not sure whether that's something supported or recommended,
I found this preferable over adding Infinispan another time as part of
the deployment. I couldn't find any recent info on doing this (would
love any pointers, though), so here's my findings, in case it's
interesting for others:

* A jboss-deployment-structure.xml file is needed for adding the
dependencies to the modules org.infinispan and org.infinispan.commons
* Unlike the core module, org.infinispan:infinispan-cdi-embedded isn't
part of WF, so it must be added to the deployment
* The transitive dependency from infinispan-cdi-embedded to
org.infinispan:infinispan-commons must be excluded, otherwise linking
errors will occur

Perhaps a small example of this could be added to the Infinispan docs?

Btw. I also couldn't find an example for configuring a cache through
jboss-cli.sh, perhaps that's something to consider, too?

Cheers,

--Gunnar


More information about the infinispan-dev mailing list