On Wed, Jun 20, 2012 at 7:43 AM, Gavin <[email protected]> wrote:
> this is the error from the geoserver log
>
> 2012-06-20 15:39:52,386 ERROR [geoserver.ows] -
> java.lang.ClassCastException:
> org.geoserver.wms.featureinfo.FeatureCollectionDecorator cannot be cast to
> org.geotools.data.simple.SimpleFeatureCollection
> at
> org.geoserver.wms.featureinfo.GML2FeatureInfoOutputFormat.write(GML2FeatureInfoOutputFormat.java:77)
> at
> org.geoserver.wms.featureinfo.GetFeatureInfoResponse.write(GetFeatureInfoResponse.java:108)
> at org.geoserver.ows.Dispatcher.response(Dispatcher.java:909)
> at
> org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:276)
>
On trunk this is happening as a result of making GetFeatureInfo work with
complex features (http://jira.codehaus.org/browse/GEOS-4351),
but it should never happen when working off standard data sources.
Where is your layer data coming from? A custom data store?
I've cc'ed Niels, the author of the change that's resulting in the
exception you're seeing.
Niels, wondering if the following test:
if (! (collection instanceof SimpleFeatureCollection)) {
//put wrapper around it with layer name
Name name = new NameImpl
(layer.getFeature().getNamespace().getName(),
layer.getFeature().getName());
collection = new FeatureCollectionDecorator(name,
collection);
}
would not be better expressed as:
collection.getSchema() instanceof SimpleFeatureType
Cheers
Andrea
--
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549
http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users