GeoServer access issues

2 messages Options
Embed this post
Permalink
Cruelemort

GeoServer access issues

Reply Threaded More More options
Print post
Permalink
I do not know if i am posting to the correct place but i am having some trouble with WFS-T using GeoTools.

I downloaded the tools and started building a program with them, ending in -

FeatureSource features = dataStore.getFeatureSource(dataStore.getTypeNames()[2]);
FeatureStore store = (FeatureStore)features;

When the last line happens i get a ClassCastException stating -

org.geotools.data.wfs.v1_1_0.WFSFeatureSource cannot be cast to org.geotools.data.FeatureStore

I have read in a couple of places that this can happen if a primary key is not defined or if you do not have write access to the table, my table does have a primary key, and GeoServer is set up to use a valid user account that should have write access...

Does anybody have any idea what might be causing this problem? Or the correct place to ask this question if this is not it...

Thanks!
Cruelemort

Re: GeoServer access issues

Reply Threaded More More options
Print post
Permalink
Problem solved, i needed to add VERSION=1.0.0 to the getcapabilities URL, solved from this post -

http://n2.nabble.com/no-subject-td2647532.html#a2647532

Thanks!

Cruelemort wrote:
I do not know if i am posting to the correct place but i am having some trouble with WFS-T using GeoTools.

I downloaded the tools and started building a program with them, ending in -

FeatureSource features = dataStore.getFeatureSource(dataStore.getTypeNames()[2]);
FeatureStore store = (FeatureStore)features;

When the last line happens i get a ClassCastException stating -

org.geotools.data.wfs.v1_1_0.WFSFeatureSource cannot be cast to org.geotools.data.FeatureStore

I have read in a couple of places that this can happen if a primary key is not defined or if you do not have write access to the table, my table does have a primary key, and GeoServer is set up to use a valid user account that should have write access...

Does anybody have any idea what might be causing this problem? Or the correct place to ask this question if this is not it...

Thanks!