I do not understand the following statement of DefaultCacheManager's Java doc. It says
CacheManagers are heavyweight objects, and we foresee no more than one CacheManager being used per JVM
Yes, you can create more cache managers. The term heavyweight here means that cache manager contains thread pools, JGroups channels (that means consumed ports) etc. so you should not create too many of these.
The situation might be a bit different in an application server with deep integration - some of the resources can be shared there. Check out the Infinispan subsystem - cache manager then maps to a cache-container
. It's perfectly fine to have multiple cache containers in the configuration.
In application server, the applications should not create the cache managers; these should be only injected (e.g. through CDI) to your webapp.