[Resending after SourceForge outage <https://twitter.com/sfnet_ops/status/913182760927297536> SF.net Operations‏ @sfnet_ops Replying to @bencdnz Hi Ben! We had issues with power at our colocation facility. Services may be intermittently interrupted while SF storage clusters re-sync.]

Lange,

in your mapping file ct_service.xml, the ct namespace is "http://www.geoserver.org/ct";, but in your datastore.xml, namespace.xml, and service2.xml, the ct namespace is "http://geoserver.org/ct"; with no "www.". This namespace mismatch will prevent app-schema from finding the element. Please try removing the "www." from the ct namespace in ct_service.xml.

Kind regards,
Ben.

On 27/09/17 20:53, Lange wrote:
Hi, thanks for reply.

i always copy schema file (service2.xsd) manually to folder d:\GeoServer\
2.11.2\data_dir\app-schema-cache\localhost\ct\ .. so i hope that the problem
is not caused by cache.
Files are attached.

Thanks a lot,
Lange
la...@email.cz


---------- Původní e-mail ----------
Od: Nuno Oliveira <nuno.olive...@geo-solutions.it>
Komu: geoserver-users@lists.sourceforge.net
Datum: 25. 9. 2017 16:07:30
Předmět: Re: [Geoserver-users] No top level element found in schemas
"
Hi,
at a first look your schema and the feature type mapping looks alright.

Did you create an workspace in GeoServer that matches your target schema ?
In your case it should be something like:
"Name: ct
Namespace URI: http://geoserver.org/ct(http://geoserver.org/ct)
" Anyway, the error you are having shouldn't be related to the workspace
existence.

You upgraded your schema to make it a GML valid one but app-schema may still
look at a cached version of the previous one, make sure to clean app-schema
cache.

The cached schemas are normally stored in a directory named app-schema-
cache:
http://docs.geoserver.org/latest/en/user/data/app-schema/app-schema-
resolution.html
(http://docs.geoserver.org/latest/en/user/data/app-schema/app-schema-resolution.html)

If none of the things above fix your issue try to share with us the full
mappings file and
schema as attached documents.

Regards,

Nuno Oliveira


On 09/25/2017 12:19 PM, Lange wrote:

"Hi, thanks for reply ...
i changed schema:

<?xml version="1.0" encoding="utf-8"?>
<xs:schema
     targetNamespace="http://geoserver.org/ct";(http://geoserver.org/ct)
     xmlns:ct="http://geoserver.org/ct";(http://geoserver.org/ct)
     xmlns:xs="http://www.w3.org/2001/XMLSchema";
(http://www.w3.org/2001/XMLSchema)
     xmlns:gml="http://www.opengis.net/gml";(http://www.opengis.net/gml)
     attributeFormDefault="unqualified"
     elementFormDefault="qualified"
     version="1.0">
    <xs:import namespace="http://www.opengis.net/gml";
(http://www.opengis.net/gml) schemaLocation="http://schemas.opengis.net/gml/
3.1.1/base/feature.xsd"
(http://schemas.opengis.net/gml/3.1.1/base/feature.xsd) />
     <xs:element name="service" type="ct:ServiceType" substitutionGroup="gml:
_Feature" />
     <xs:complexType name="ServiceType">
         <xs:complexContent>
             <xs:extension base="gml:AbstractFeatureType">
                 <xs:sequence>
                     <xs:element name="Id" type="xs:string" />
                     <xs:element name="Code" type="xs:string" />
                 </xs:sequence>
             </xs:extension>
         </xs:complexContent>
     </xs:complexType>
</xs:schema>

and also mapping:
...
<typeMappings>
         <FeatureTypeMapping>
             <sourceDataStore>datastore</sourceDataStore>
             <sourceType>service_v</sourceType>
             <targetElement>ct:service</targetElement>
             <attributeMappings>
                 <AttributeMapping>
                     <targetAttribute>Id</targetAttribute>
                     <sourceExpression>
                         <OCQL>id</OCQL>
                     </sourceExpression>
                      <encodeIfEmpty>true</encodeIfEmpty>
                  </AttributeMapping>
                 <AttributeMapping>
                     <targetAttribute>Code</targetAttribute>
                     <sourceExpression>
                         <OCQL>code</OCQL>
                     </sourceExpression>
                      <encodeIfEmpty>true</encodeIfEmpty>
                  </AttributeMapping>
             </attributeMappings>
         </FeatureTypeMapping>
     </typeMappings>

where service_v is db view:
create view service_v as
select id::text, code from service;


But result is the same:

There was an error trying to connect to store ct_service. Do you want to
save it anyway?


Original exception error:

java.util.NoSuchElementException: No top level element found in schemas: {
http://www.geoserver.org/ct(http://www.geoserver.org/ct)}service



Thanks for any other idea,



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot



_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

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


--
Ben Caradoc-Davies <b...@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

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

Reply via email to