When working on another project using Infinispan the code being used was a bit interesting and I don't think our template configuration handling was expecting it do so in such a way.
Essentially the code defined a template for a distributed cache as well as some named caches. Then whenever a cache is retrieved it would pass the given name and always the distributed cache template. Unfortunately with the way templates work they essentially redefine a cache first so the actual cache configuration was wiped out. In this example I was able to get the code to change to using a default cache instead, which is the behavior that is needed.
The issue though at hand is whether we should allow a user to call getCache in such a way. My initial thought is to have it throw some sort of configuration exception when this is invoked. But there are some possible options.