When a new layer group is created on a master node, the layer group definition is serialized and published to the slave nodes.
Performing a get map operation using the created layer group on a slave node will provoke a NULL pointer exception:
Reloading the GeoServer slave instance fixes the problem.
This issue happens because the catalog field of StoreInfo default implementation is transient, hence is not serialized when the layer group is published by the master node:
When adding the new layer group to the catalog of the slave instance the layer group associated stores are not initialized:
This also why, when the GeoServer instance is reloaded the issue is gone.
To reproduce this issue just created a layer group with the JMS plugin installed and try to do a layer preview on a slave node.