I have been testing some queries to a complex feature service using app-schema 
and am getting the following exception report for one query:

<ows:ExceptionReport version="1.0.0"
  xsi:schemaLocation="http://www.opengis.net/ows 
http://xxxx.geosciml.org/xxxxxxxx/schemas/ows/1.0.0/owsExceptionReport.xsd";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ows="http://www.opengis.net/ows";>
  <ows:Exception exceptionCode="NoApplicableCode">
    <ows:ExceptionText>java.lang.ClassCastException: 
org.geotools.feature.NameImpl cannot be cast to 
org.opengis.feature.type.AttributeDescriptor
org.geotools.feature.NameImpl cannot be cast to 
org.opengis.feature.type.AttributeDescriptor</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Details as below:

Tested versions v2.3.1 and nightly build of 2013-05-09

The source data is in PostGIS with the tables created by the scripts in 
https://www.seegrid.csiro.au/subversion/GeoSciML/cgi-reference-dataset/tags/2013-05-15/data/database/cgi-reference-postgis.sql

The GeoServer app-schema configuration files are as in the data directory 
https://www.seegrid.csiro.au/subversion/GeoSciML/cgi-reference-dataset/tags/2013-05-15/services/geoserver/postgis/data

app-schema joining has been switched on.

The query which fails with the above exception is:

Query 1 (fails)
---
<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";
    xmlns:gsml="http://xmlns.geosciml.org/GeoSciML-Core/3.1";
    xmlns:gsmlgu="http://xmlns.geosciml.org/GeologicUnit/3.1"; 
xmlns:ogc="http://www.opengis.net/ogc";
    xmlns:wfs="http://www.opengis.net/wfs";
    xmlns:gml="http://www.opengis.net/gml/3.2"; service="WFS"
    version="1.1.0"
    maxFeatures="100"
    outputFormat="gml32">
    <wfs:Query typeName="gsml:MappedFeature">
        <ogc:Filter>
            <ogc:PropertyIsEqualTo>
                
<ogc:PropertyName>gsml:specification/gsmlgu:GeologicUnit/gsml:relatedFeature/gsmlga:GeologicHistory/gsml:relatedFeature/gsmlga:GeologicEvent/gsmlga:olderNamedAge/@xlink:href</ogc:PropertyName>
                
<ogc:Literal>http://resource.geosciml.org/classifier/ics/ischart/Devonian</ogc:Literal>
            </ogc:PropertyIsEqualTo>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>

---

A similar query but which queries some element rather than attribute content 
below works correctly to retrieve the matching features.

Query 2 (succeeds)
---

<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";
    xmlns:gsml="http://xmlns.geosciml.org/GeoSciML-Core/3.1";
    xmlns:gsmlgu="http://xmlns.geosciml.org/GeologicUnit/3.1"; 
xmlns:ogc="http://www.opengis.net/ogc";
    xmlns:wfs="http://www.opengis.net/wfs";
    xmlns:gml="http://www.opengis.net/gml/3.2"; service="WFS"
    version="1.1.0"
    maxFeatures="100"
    outputFormat="gml32">
    <wfs:Query typeName="gsml:MappedFeature">
        <ogc:Filter>
            <ogc:PropertyIsEqualTo>
                
<ogc:PropertyName>gsml:specification/gsmlgu:GeologicUnit/gsml:relatedFeature/gsmlga:GeologicHistory/gsml:relatedFeature/gsmlga:GeologicEvent/gsmlga:eventEnvironment/swe:Category/swe:label</ogc:PropertyName>
                <ogc:Literal>terrestrial setting</ogc:Literal>
            </ogc:PropertyIsEqualTo>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>

---

Another query very similar to Query 1 that queries the contents of the same 
xlink:href attribute but queries on gsmlgu:GeologicUnit features rather than 
the parent gsml:MappedFeature features of Query 1 succeeds in retrieving the 
matching features:

Query 3 (succeeds)
---
<?xml version="1.0" encoding="UTF-8"?>
<wfs:GetFeature xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd";
    xmlns:gsmlgu="http://xmlns.geosciml.org/GeologicUnit/3.1"; 
xmlns:ogc="http://www.opengis.net/ogc";
    xmlns:wfs="http://www.opengis.net/wfs";
    xmlns:gml="http://www.opengis.net/gml/3.2"; service="WFS"
    version="1.1.0"
    maxFeatures="100"
    outputFormat="gml32">
    <wfs:Query typeName="gsmlgu:GeologicUnit">
        <ogc:Filter>
            <ogc:PropertyIsEqualTo>
                
<ogc:PropertyName>gsml:relatedFeature/gsmlga:GeologicHistory/gsml:relatedFeature/gsmlga:GeologicEvent/gsmlga:olderNamedAge/@xlink:href</ogc:PropertyName>
                
<ogc:Literal>http://resource.geosciml.org/classifier/ics/ischart/Devonian</ogc:Literal>
            </ogc:PropertyIsEqualTo>
        </ogc:Filter>
    </wfs:Query>
</wfs:GetFeature>

---

Any ideas? Should I report a bug?

Marcus Sen

This message (and any attachments) is for the recipient only. NERC is subject 
to the Freedom of Information Act 2000 and the contents of this email and any 
reply you make may be disclosed by NERC unless it is exempt from release under 
the Act. Any material supplied to NERC may be stored in an electronic records 
management system.
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to