Hi Feniks, Normally that means your trying to add the same feature type more than once to the data store. I can't see anything wrong with your mappings on a first glance. You didn't by any chance configure Z as a feature type?
Regards Niels On 21-11-14 16:03, Feniks wrote: > Hello, > > I have a question regarding feature chaining of complex features. I have a > complex feature X which I want to chain with a non feature Z. The error > that I'm getting is the following: > > Error creating data store, check the parameters. > Error message: Duplicate mappingName or targetElement across > FeatureTypeMapping instances detected. They have to be unique, or app-schema > doesn't know which one to get. Please check your mapping file(s) with > mappingName or targetElement of: > > I tried some possible solutions that I found on the internet but nothing > seems to work, so then I started to wonder if the schema is wrong? > I'm providing examples of mapping files for X and Z, and their schema. > Hopefully someone, who worked a lot more with feature chaining, will be able > to find a solution to my problem. > > Regards > * > Schema for mapping files:* > <?xml version="1.0" encoding="UTF-8"?> > <schema xmlns="http://www.w3.org/2001/XMLSchema" > xmlns:prefix="www.default.com" xmlns:gml="http://www.opengis.net/gml/3.2" > elementFormDefault="qualified" targetNamespace="www.default.com"> > > <import namespace="http://www.opengis.net/gml/3.2" > schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd"/> > > <element name="X" type="prefix:XType"/> > > <complexType name="XType"> > <complexContent> > <extension base="gml:AbstractFeatureType"> > <sequence> > <element name="id" type="string" > minOccurs="0"/> > <element name="name" type="string" > minOccurs="0"/> > <element name="ZId" type="string" > minOccurs="0"/> > <element name="Y" minOccurs="0"> > <complexType> > <sequence> > <element > ref="prefix:Z" /> > </sequence> > </complexType> > </element> > > </sequence> > </extension> > </complexContent> > </complexType> > > <element name="Z" type="prefix:ZType"/> > <complexType name="ZType"> > <complexContent> > <extension base="gml:AbstractFeatureType"> > <sequence> > <element name="id" type="string" > minOccurs="0"/> > <element name="name" type="string" > minOccurs="0"/> > </sequence> > </extension> > </complexContent> > </complexType> > > </schema> > > *Mapping file for X:* > <?xml version="1.0" encoding="UTF-8"?> > <as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.geotools.org/app-schema > AppSchemaDataAccess.xsd"> > <namespaces> > <Namespace> > <prefix>prefix</prefix> > <uri>www.default.com</uri> > </Namespace> > </namespaces> > <includedTypes> > <Include>Zmapping.xml</Include> > </includedTypes> > <sourceDataStores> > <DataStore> > <id>datastore</id> > <parameters> > <Parameter> > <name>dbtype</name> > <value>postgisng</value> > </Parameter> > ... > </parameters> > </DataStore> > </sourceDataStores> > <targetTypes> > <FeatureType> > <schemaUri>schema.xsd</schemaUri> > </FeatureType> > </targetTypes> > <typeMappings> > <FeatureTypeMapping> > <sourceDataStore>datastore</sourceDataStore> > <sourceType>Table_X</sourceType> > <targetElement>prefix:X</targetElement> > <attributeMappings> > <AttributeMapping> > <targetAttribute> > prefix:name > </targetAttribute> > <sourceExpression> > <OCQL>name</OCQL> > </sourceExpression> > </AttributeMapping> > <AttributeMapping> > > <targetAttribute>prefix:Y</targetAttribute> > <sourceExpression> > <OCQL>zid</OCQL> > > <linkElement>prefix:Z</linkElement> > > <linkField>FEATURE_LINK</linkField> > </sourceExpression> > </AttributeMapping> > </attributeMappings> > </FeatureTypeMapping> > </typeMappings> > </as:AppSchemaDataAccess> > > *Mapping file for Z:* > <?xml version="1.0" encoding="UTF-8"?> > <as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://www.geotools.org/app-schema > AppSchemaDataAccess.xsd"> > <namespaces> > <Namespace> > <prefix>prefix</prefix> > <uri>www.default.com</uri> > </Namespace> > </namespaces> > <sourceDataStores> > <DataStore> > <id>datastore</id> > <parameters> > <Parameter> > <name>dbtype</name> > <value>postgisng</value> > </Parameter> > ... > </parameters> > </DataStore> > </sourceDataStores> > <targetTypes> > <FeatureType> > <schemaUri>schema.xsd</schemaUri> > </FeatureType> > </targetTypes> > <typeMappings> > <FeatureTypeMapping> > <sourceDataStore>datastore</sourceDataStore> > <sourceType>Table_Z</sourceType> > <targetElement>prefix:Z</targetElement> > <attributeMappings> > <AttributeMapping> > <targetAttribute> > prefix:name > </targetAttribute> > <sourceExpression> > <OCQL>name</OCQL> > </sourceExpression> > </AttributeMapping> > <AttributeMapping> > > <targetAttribute>FEATURE_LINK</targetAttribute> > <sourceExpression> > <OCQL>id</OCQL> > </sourceExpression> > </AttributeMapping> > </attributeMappings> > </FeatureTypeMapping> > </typeMappings> > </as:AppSchemaDataAccess> > > > > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/Complex-feature-chaining-tp5174246.html > Sent from the GeoServer - User mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > Geoserver-users mailing list > Geoserver-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/geoserver-users ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users