New created styles will not be published by JMS plugin

Description

Any style addition will provoke this exception in JMS publisher:

1 2 3 org.geoserver.catalog.CatalogException: java.lang.IllegalStateException: Unable to find style for event: StyleInfoImpl[test_style] at org.geoserver.cluster.server.JMSCatalogListener.handleAddEvent(JMSCatalogListener.java:118)

This issue is provoked by this check:
https://github.com/geoserver/geoserver/blob/master/src/community/jms-cluster/jms-geoserver/src/main/java/org/geoserver/cluster/server/JMSCatalogListener.java#L103-L105

We actually want to make sure that the style resource is of type RESOURCE, so the check should be like this:

1 2 3 4 5 if(!Resources.exists(styleFile) || !Resources.canRead(styleFile) || !(styleFile.getType() == Type.RESOURCE)){ throw new IllegalStateException("Unable to find style for event: "+sInfo.toString()); }

To reproduce this issue just create a style with the JMS plugin installed.

Environment

None

Status

Assignee

Nuno Oliveira

Reporter

Nuno Oliveira

Triage

None

Fix versions

Affects versions

2.9.3
2.10.1
2.11-beta

Components

Priority

Medium
Configure