Skip to content

Exception on resolving namespace when using Open Layers with 12.1 geotools and 2.6.1 geoserver. #132

@rwgdrummer

Description

@rwgdrummer

The namespace is not found in the catalog.
Steps to reproduce:
Ingest feature data into accumulo.
Create a workspace, attach to the geowave datasource and create a layer for the ingested data.
Use OpenLayers in the Layer Preview. Select a single point with the mouse.

Analysis:

(1) We did not see this issue before because the code set 'null' on the URI for the feature type explicitly. There is some compensating code in geoserver that defaults to the workspace URI in this case. However, as we know from the recent bug fix, this break WFS transactions in 2.6

(2) We see the issue now when we explicitly set the name space due to this odd bit of code in GeoServer (CatalogBuilder) which is invoked when first building a layer. I added comments

    Name name = featureSource.getName();
    if (name == null) {
        name = featureType.getName();   // the Name here is based on the featureNamespace URI.
    }

// notice it is ignored
ftinfo.setNativeName(name.getLocalPart());
ftinfo.setName(name.getLocalPart());

    WorkspaceInfo workspace = store.getWorkspace();
    NamespaceInfo namespace = catalog.getNamespaceByPrefix(workspace.getName());

// now it takes the namespace name.
if (namespace == null) {
namespace = catalog.getDefaultNamespace();
}
// and overwrites it.
ftinfo.setNamespace(namespace);

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions