The Infinispan L2 cache serializes the CacheKey instance and sends that to other nodes in the cluster to invalidate cache entries. The CacheKey implements Serializable, but it is not always actually serializable. When the CacheKey represents a composite primary key, the type variable is set to an instance of EmbeddedComponentType, which indirectly references SessionFactoryImpl. While SessionFactoryImpl is serializable within a JVM, it is not serializable across JVMs.
This causes the following marshalling error in Infinispan:
Infinispan L2 cache