[Geoserver-users] spurious style-related error.

Hi,

I’m getting the following ServiceException when I try to render a newly-added PostGIS layer:

“The requested Style can not be used with this layer. The style specifies an attribute of status”

I know this isn’t the whole truth because if I hit the Load button in the admin interface, the problem goes away.

This problem only happens with certain layers, but it happens consistently if I re-add the layer. I’m adding layers from a PHP script rather than through a browser, so perhaps that’s part of the problem. Here are the fields I’m submitting:

‘styleId’ => $style,
‘SRS’ => $srs,
‘title’ => $title,
‘keywords’ => $keywords,
‘abstract’ => $abstract,
‘wmsPath’ => $wmspath,
‘schemaBase’ => ‘–’,
‘autoGenerateExtent’ => ‘true’,
‘action’ => ‘Submit’

Setup:
Geoserver 1.6.2 running standalone on Fedora 8, Sun Java 1.5.0_15-b04

Traceback:
org.vfny.geoserver.wms.WmsException: The requested Style can not be used with this layer. The style specifies an attribute of status and the layer is: eon_dev:St-Ambroise_default_parcels
at org.geoserver.wms.kvp.GetMapKvpRequestReader.checkStyle(GetMapKvpRequestReader.java:970)
at org.geoserver.wms.kvp.GetMapKvpRequestReader.read(GetMapKvpRequestReader.java:317)
at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1002)
at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:371)
at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:185)

(let me know i you want the whole thing).

Any solutions or troubleshooting suggestions would be appreciated.

Thanks,
Dan

Hi Dan,

What this error is telling you is that the style youa re specifying references an attribute (status) that does not exist in your dataset.
Can you verify that this attribute exists on your table?

-Justin

Dan Lipsitt wrote:

Hi,

I'm getting the following ServiceException when I try to render a newly-added PostGIS layer:

"The requested Style can not be used with this layer. The style specifies an attribute of status"

I know this isn't the whole truth because if I hit the Load button in the admin interface, the problem goes away.

This problem only happens with certain layers, but it happens consistently if I re-add the layer. I'm adding layers from a PHP script rather than through a browser, so perhaps that's part of the problem. Here are the fields I'm submitting:

    'styleId' => $style,
    'SRS' => $srs,
    'title' => $title,
    'keywords' => $keywords,
    'abstract' => $abstract,
    'wmsPath' => $wmspath,
    'schemaBase' => '--',
    'autoGenerateExtent' => 'true',
    'action' => 'Submit'

Setup:
Geoserver 1.6.2 running standalone on Fedora 8, Sun Java 1.5.0_15-b04

Traceback:
org.vfny.geoserver.wms.WmsException: The requested Style can not be used with this layer. The style specifies an attribute of status and the layer is: eon_dev:St-Ambroise_default_parcels
        at org.geoserver.wms.kvp.GetMapKvpRequestReader.checkStyle(GetMapKvpRequestReader.java:970)
        at org.geoserver.wms.kvp.GetMapKvpRequestReader.read(GetMapKvpRequestReader.java:317)
        at org.geoserver.ows.Dispatcher.parseRequestKVP(Dispatcher.java:1002)
        at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:371)
        at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:185)
       ...

(let me know i you want the whole thing).

Any solutions or troubleshooting suggestions would be appreciated.

Thanks,
Dan
!DSPAM:4007,4806695c138701439371379!

------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

!DSPAM:4007,4806695c138701439371379!

------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,4806695c138701439371379!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

On Wed, Apr 16, 2008 at 5:17 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Hi Dan,

What this error is telling you is that the style youa re specifying references an attribute (status) that does not exist in your dataset.
Can you verify that this attribute exists on your table?

-Justin

Yes, the attribute exists, and as I said earlier, the error goes away if I hit the load button.

Yes, the attribute exists, and as I said earlier, the error goes away if I hit the load button.

Apologies, missed that in your original post. So... the issue seems to be that the layer configuration object does not contain the necessary attribute information directly after your post, and does not until you hit reload.

I cant say i am too suprised... that method of adding layers is not exactly bullet proof.

Which version of GeoServer are you using? 1.6.x perhaps? A recent post on the list stated that it did not work completely with 1.6.x. ALthough I think it was recently fixed.

See:

http://www.nabble.com/See-new-featureTypes-without-restarting-GeoServer-td16659929.html

!DSPAM:4007,48066d97145407082231907!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

On Wed, Apr 16, 2008 at 5:50 PM, Justin Deoliveira <jdeolive@anonymised.com> wrote:

Yes, the attribute exists, and as I said earlier, the error goes away if I hit the load button.

Apologies, missed that in your original post. So… the issue seems to be that the layer configuration object does not contain the necessary attribute information directly after your post, and does not until you hit reload.

I cant say i am too suprised… that method of adding layers is not exactly bullet proof.

It’s strange because it usually works, and I know the data is getting into the config because it works after the reload. Can you think of a way that the data could be partially-loaded?

The annoying thing is that the reload workaround only seems to work through the browser. Since the whole point is to create layers without using the GUI, this is a problem. I’ve been trying to do it from my PHP code but it doesn’t work.

Which version of GeoServer are you using? 1.6.x perhaps? A recent post on the list stated that it did not work completely with 1.6.x. ALthough I think it was recently fixed.

I just upgraded from 1.6.2 to 1.6.3 but it didn’t help.

See:

http://www.nabble.com/See-new-featureTypes-without-restarting-GeoServer-td16659929.html

Hm. My code is based on the http://geoserver.org/display/GEOSDOC/Alternative+for+reloading+the+Geoserver+catalog page mentioned in that message. Andrea says for 1.6.x you need to skip the login and use http auth, but I’ve mostly been doing fine with the login. I don’t think that switching the auth would help. Do you?

Thanks for your help,
Dan