I am using GeoServer v2.4RC1 with app-schema plugin to map 3 related PostGIS 
tables to GeoSciML v3.2 features.

I'm getting an error about trying to access a column which doesn't exist in the 
underlying table although no part of my mapping files refer to this column. 
Below I include the error message, the SQL query which GeoServer is trying to 
execute (taken from PostgreSQL logs) and the bits of the mapping file that 
specify the feature chaining between the two features that seem to be relevant 
to the error. I've set app-schema.joining = true explicitly although I believe 
this should be the default anyway for this version of GeoServer.

Any ideas why GeoServer is trying to access the objectid column of my table?

Marcus Sen

The relevant part of the error message is:

-----
Caused by: java.lang.RuntimeException: Error applying mapping with 
targetAttribute gsml:specification
        at 
org.geotools.data.complex.DataAccessMappingFeatureIterator.computeNext(DataAccessMappingFeatureIterator.java:1018)
        at 
org.geotools.data.complex.AbstractMappingFeatureIterator.next(AbstractMappingFeatureIterator.java:338)
        at 
org.geotools.data.complex.MappingFeatureCollection.getBounds(MappingFeatureCollection.java:197)
        ... 90 more
Caused by: java.lang.RuntimeException: java.io.IOException
        at 
org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:168)
        at 
org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:59)
        at 
org.geotools.data.complex.DataAccessMappingFeatureIterator.initialiseSourceFeatures(DataAccessMappingFeatureIterator.java:377)
        at 
org.geotools.data.complex.AbstractMappingFeatureIterator.<init>(AbstractMappingFeatureIterator.java:206)
        at 
org.geotools.data.complex.AbstractMappingFeatureIterator.<init>(AbstractMappingFeatureIterator.java:152)
        at 
org.geotools.data.complex.DataAccessMappingFeatureIterator.<init>(DataAccessMappingFeatureIterator.java:160)
        at 
org.geotools.data.complex.MappingFeatureIteratorFactory.getInstance(MappingFeatureIteratorFactory.java:146)
        at 
org.geotools.data.complex.MappingFeatureCollection.features(MappingFeatureCollection.java:174)
        at 
org.geotools.data.joining.JoiningNestedAttributeMapping.initSourceFeatures(JoiningNestedAttributeMapping.java:204)
        at 
org.geotools.data.joining.JoiningNestedAttributeMapping.getFeatures(JoiningNestedAttributeMapping.java:383)
        at 
org.geotools.data.complex.DataAccessMappingFeatureIterator.setAttributeValue(DataAccessMappingFeatureIterator.java:568)
        at 
org.geotools.data.complex.DataAccessMappingFeatureIterator.computeNext(DataAccessMappingFeatureIterator.java:1005)
        ... 92 more
Caused by: java.io.IOException
        at 
org.geotools.jdbc.JoiningJDBCFeatureSource.getJoiningReaderInternal(JoiningJDBCFeatureSource.java:659)
        at 
org.geotools.jdbc.JoiningJDBCFeatureSource.getReaderInternal(JoiningJDBCFeatureSource.java:667)
        at 
org.geotools.data.store.ContentFeatureSource.getReader(ContentFeatureSource.java:563)
        at 
org.geotools.data.store.ContentFeatureCollection.features(ContentFeatureCollection.java:165)
        ... 103 more
Caused by: org.postgresql.util.PSQLException: ERROR: column 
uk_625k_bedrock_geol_unit.objectid does not exist
  Position: 2944
        at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2062)

-----

I am using Feature chaining between the tables so for example in my 
gsml_MappedFeature.xml mapping file which maps the UK_625K_BEDROCK_WGS84 table 
to gsml:MappedFeature features I have the section:

-----

<AttributeMapping>
        <targetAttribute>gsml:specification</targetAttribute>
        <sourceExpression>
                <OCQL>lex_rcs</OCQL>
          <linkElement>gsmlgu:GeologicUnit</linkElement>
                <linkField>FEATURE_LINK</linkField>
        </sourceExpression>
</AttributeMapping>

-----

and in my gsmlgu_GeologicUnit.xml mapping file which maps the 
uk_625k_bedrock_geol_unit table to gsmlgu:GeologicUnit features I have the 
section:

-----

<AttributeMapping>
        <targetAttribute>FEATURE_LINK</targetAttribute>
        <sourceExpression><OCQL>lex_rcs</OCQL></sourceExpression>
</AttributeMapping>

-----

The query which GeoServer tries to execute is:

-----
SELECT "public"."uk_625k_bedrock_geol_unit"."lex_rcs",
"public"."uk_625k_bedrock_geol_unit"."lex",
"public"."uk_625k_bedrock_geol_unit"."rcs",
"public"."uk_625k_bedrock_geol_unit"."name_urn",
"public"."uk_625k_bedrock_geol_unit"."name",
"public"."uk_625k_bedrock_geol_unit"."lex_d",
"public"."uk_625k_bedrock_geol_unit"."rank",
"public"."uk_625k_bedrock_geol_unit"."ics_urn",
"public"."uk_625k_bedrock_geol_unit"."rcs_urn",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunittype",
"public"."uk_625k_bedrock_geol_unit"."oge_age_max",
"public"."uk_625k_bedrock_geol_unit"."oge_age_min",
"public"."uk_625k_bedrock_geol_unit"."oge_eventenvironment",
"public"."uk_625k_bedrock_geol_unit"."oge_eventprocess",
"public"."uk_625k_bedrock_geol_unit"."oge_lithology_1",
"public"."uk_625k_bedrock_geol_unit"."oge_proportionterms_1",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunitpartrole_1",
"public"."uk_625k_bedrock_geol_unit"."oge_lithology_2",
"public"."uk_625k_bedrock_geol_unit"."oge_proportionterms_2",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunitpartrole_2",
"public"."uk_625k_bedrock_geol_unit"."oge_lithology_3",
"public"."uk_625k_bedrock_geol_unit"."oge_proportionterms_3",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunitpartrole_3",
"public"."uk_625k_bedrock_geol_unit"."oge_lithology_4",
"public"."uk_625k_bedrock_geol_unit"."oge_proportionterms_4",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunitpartrole_4",
"public"."uk_625k_bedrock_geol_unit"."oge_lithology_5",
"public"."uk_625k_bedrock_geol_unit"."oge_proportionterms_5",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunitpartrole_5",
"public"."uk_625k_bedrock_geol_unit"."oge_metamorphicgrade",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunittype_uri",
"public"."uk_625k_bedrock_geol_unit"."oge_eventenvironment_uri",
"public"."uk_625k_bedrock_geol_unit"."oge_eventprocess_uri",
"public"."uk_625k_bedrock_geol_unit"."oge_metamorphic_grade_uri",
"public"."uk_625k_bedrock_geol_unit"."oge_geologicunittype_label",
"public"."uk_625k_bedrock_geol_unit"."oge_age_max_label",
"public"."uk_625k_bedrock_geol_unit"."oge_age_min_label",
"public"."uk_625k_bedrock_geol_unit"."oge_eventenvironment_label",
"public"."uk_625k_bedrock_geol_unit"."oge_eventprocess_label",
"public"."uk_625k_bedrock_geol_unit"."oge_metamorphic_grade_label",
"public"."uk_625k_bedrock_geol_unit"."rank_uri",
"public"."uk_625k_bedrock_geol_unit"."rank_label",
"public"."uk_625k_bedrock_geol_unit"."cgi_ics_age_max_uri",
"public"."uk_625k_bedrock_geol_unit"."cgi_ics_age_min_uri",
"public"."UK_625K_BEDROCK_WGS84"."mfid" FOREIGN_ID_0_0
FROM "public"."uk_625k_bedrock_geol_unit"
INNER JOIN
"public"."UK_625K_BEDROCK_WGS84"
ON
( "UK_625K_BEDROCK_WGS84"."lex_rcs" = "uk_625k_bedrock_geol_unit"."lex_rcs")
ORDER BY
"public"."UK_625K_BEDROCK_WGS84"."mfid" ASC,
"public"."uk_625k_bedrock_geol_unit"."lex_rcs" ASC,
CASE WHEN "UK_625K_BEDROCK_WGS84"."lex_rcs" = 
"uk_625k_bedrock_geol_unit"."lex_rcs" THEN 0 ELSE 1 END ASC, 
"public"."uk_625k_bedrock_geol_unit"."objectid"

-----


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.
------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to