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:
java.lang.NullPointerException at org.geoserver.catalog.impl.DataStoreInfoImpl.getDataStore(DataStoreInfoImpl.java:38)
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: https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/catalog/impl/StoreInfoImpl.java#L39 When adding the new layer group to the catalog of the slave instance the layer group associated stores are not initialized: https://github.com/geoserver/geoserver/blob/master/src/main/src/main/java/org/geoserver/catalog/impl/DefaultCatalogFacade.java#L493-L495 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. |