Several potential causes:
* the cache name is wrong (DOC_PROCESS_CACHE)?
* Errors/warnings in log (Enable TRACE to see what's up)? Maybe transaction manager is not being located?
* Configuration is being overriden/ignored - log or stepping through the code
* Bug? Attach a reproducable environment, or try with latest Wildfly (maybe it's been fixed)?
In WF10/EAP7, cache configurations are installed on-demand, thus, the above code is not sufficient to ensure that your "doc-lock" cache configuration is installed into the mt-cluster-cache container.
To properly inject a configured cache into your application, add the following to your deployment descriptor:
<resource-ref> <res-ref-name>infinispan/doc-lock</res-ref-name> <lookup-name>java:jboss/infinispan/cache/mt-cluster-cache/doc-lock</lookup-name> </resource-ref>
Now, inject the cache itself into your class:
@Resource(name="infinispan/doc-lock") private Cache<DocumentProcessKey, Boolean> cache;