[GIS] Geoserver does not see new layers

layersopenlayers-2

I have an existing GeoServer instance running (version 2.1.3). This GeoServer has multiple Workspaces and Stores serving a number of layers as WFS to an OpenLayers map.

I want to update my Stores every quarter with the most recent layers. The process goes like this:

1) Delete the GeoServer Store (for example Store: "3rdQ2012") under Workspace "A" that contains the previous quarters shapefile.
2) Create a new GeoServer Store (for example Store: "4thQ2012") under Workspace "A" for the new layer.
3) Edit my OpenLayers map project to point to the new layer.

For some reason when I do this GeoServer is not serving the new layer. When I look at the GeoServer log file I see this message for the affected layer:

"2012-12-21 16:15:33,965 WARN [geotools.gml] – Could find type for nameOfLayer in the schema, generating type from feature."

When I go to the GeoServer "Layer Preview" page I can successfully see and select "OpenLayers" under the common formats column GeoServer successfully opens a map window and displays the layer. But, when I select GML under the common formats column GeoServer opens a new window and displays this :

" This XML file does not appear to have any style information associated with it. The document tree is shown below.
http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
java.lang.NullPointerException null
"

It appears that GeoServer is not seeing my new layer or perhaps something is not updating correctly after updating my stores and layers.

I have tried restarting my GeoServer service as well as doing restarts on the server. I have also deleted the workspace, stores, and layers multiple times in an attempt to force GeoServer to update but all to no avail.

Any suggestions would be appreciated. Thanks!

Best Answer

I found the problem. For some reason my new layers were being programmatically assigned to the wrong store. Even though GeoServer appeared to show them as being assigned to "Store A" when I accessed the layers using WFS they were being listed as belonging to "Store B".

To fix this problem I assigned each layer to a different (incorrect) store and then saved. Then I went back in and assigned the layer to the correct store. Now GeoServer is showing the correct store name for each layer.