[Geoserver-users] App-Schema Publish Layer Exception

Hello,

I’d be very grateful if someone could assist me with the following problem:

I’m trying to publish a GML layer whose data is sourced from a PostGIS database and mapped to a GMLAS via the GeoServer app-schema plugin. Unfortunately, on publishing the layer, I get the following DataSourceException:

http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available: [http://www.envitia.com/schemas/1.0:TownSurvey]”

Given below are my GML Application Schema, my app-schema mapping file, and the call stack for the DataSourceException.

Can anyone assist me in identifying the cause of the issue please?

Best Regards,

Ryan

= = =

GML Application Schema

= = =

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema” xmlns:gml=“http://www.opengis.net/gml/3.2” xmlns:town=“http://www.envitia.com/schemas/1.0” targetNamespace=“http://www.envitia.com/schemas/1.0” elementFormDefault=“qualified”>

<xs:import namespace=“http://www.opengis.net/gml/3.2” schemaLocation=“http://schemas.opengis.net/gml/3.2.1/gml.xsd”/>

<xs:element name=“TownSurvey” type=“town:TownSurveyType” substitutionGroup=“gml:AbstractFeature”/>

<xs:complexType name=“town:TownSurveyType”>

xs:complexContent

<xs:extension base=“gml:AbstractFeatureType”>

xs:sequence

<xs:element name=“townName” type=“xs:string”/>

<xs:element name=“townSize” type=“xs:integer”/>

</xs:sequence>

</xs:extension>

</xs:complexContent>

</xs:complexType>

</xs:schema>

= = =

Mapping File

= = =

<?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”>

gml

http://www.opengis.net/gml/3.2

town

http://www.envitia.com/schemas/1.0

DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe

dbtype

postgis

host

localhost

port

MyPort

database

MyDatabase

user

MyUser

passwd

MyPassword

http://test3.test2.test1/MyGMLAS.xsd

DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe

townssurvey_poly

town:TownSurvey

town:townName

TOWN

</as:AppSchemaDataAccess>

= = =

Error Stack Trace

= = =

java.lang.RuntimeException: Error occurred while building the resources for the configuration page

at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:302)

at org.geoserver.web.data.layer.NewLayerPage$6.onClick(NewLayerPage.java:241)

at org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:45)

at org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68)

at org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)

at org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:300)

at org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)

at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)

at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)

at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)

at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)

at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)

at org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:159)

at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)

at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)

at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)

at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)

at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:115)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:46)

at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)

at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:103)

at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)

at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)

at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)

at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)

at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:324)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

Caused by: org.geotools.data.DataSourceException: http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available: [http://www.envitia.com/schemas/1.0:TownSurvey]

at org.geotools.data.complex.AppSchemaDataAccess.getMappingByElement(AppSchemaDataAccess.java:201)

at org.geotools.data.complex.AppSchemaDataAccess.getSchema(AppSchemaDataAccess.java:157)

at org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:842)

at org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:799)

at org.geoserver.catalog.impl.FeatureTypeInfoImpl.getFeatureType(FeatureTypeInfoImpl.java:87)

at org.geoserver.catalog.CatalogBuilder.getDefaultStyle(CatalogBuilder.java:1271)

at org.geoserver.catalog.CatalogBuilder.buildLayer(CatalogBuilder.java:1219)

at org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:296)

… 93 more

= = =

Regards,

Ryan

Ryan,

the web administration interface does not support the app-schema plugin. Attempting to use the web administration interface to publish app-schema layers will generate confusing and unhelpful errors. Note that the app-schema plugin *does* honour WFS service setting configured through the web interface.

Once an app-schema data store has been configured by editing files, it is available for use on the the next GeoServer restart. No administrative actions are required. Have you tried a WFS query for your type?

Note also that the DataStore/id in your mapping file is local to that file and distinct from the datastore id in datastore.xml.

Kind regards,
Ben.

On 08/06/13 00:09, Ryan Moody wrote:

Hello,

I’d be very grateful if someone could assist me with the following problem:

I’m trying to publish a GML layer whose data is sourced from a PostGIS
database and mapped to a GMLAS via the GeoServer app-schema plugin.
Unfortunately, on publishing the layer, I get the following
DataSourceException:

http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available:
[http://www.envitia.com/schemas/1.0:TownSurvey\]”

Given below are my GML Application Schema, my app-schema mapping file,
and the call stack for the DataSourceException.

Can anyone assist me in identifying the cause of the issue please?

Best Regards,

Ryan

= = =

GML Application Schema

= = =

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot;
xmlns:gml="http://www.opengis.net/gml/3.2&quot;
xmlns:town="http://www.envitia.com/schemas/1.0&quot;
targetNamespace="http://www.envitia.com/schemas/1.0&quot;
elementFormDefault="qualified">

                 <xs:import namespace="http://www.opengis.net/gml/3.2&quot;
schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;/&gt;

                 <xs:element name="TownSurvey"
type="town:TownSurveyType" substitutionGroup="gml:AbstractFeature"/>

                 <xs:complexType name="town:TownSurveyType">

                                 <xs:complexContent>

                                                 <xs:extension
base="gml:AbstractFeatureType">

<xs:sequence>

                                                                                 <xs:element name="townName" type="xs:string"/>

                                                                                 <xs:element name="townSize" type="xs:integer"/>

</xs:sequence>

                                                 </xs:extension>

                                 </xs:complexContent>

                 </xs:complexType>

</xs:schema>

= = =

Mapping File

= = =

<?xml version="1.0" encoding="UTF-8"?>

<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema&quot;

     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

     xsi:schemaLocation="http://www.geotools.org/app-schema
AppSchemaDataAccess.xsd">

     <namespaces>

                                 <Namespace>

                                                 <prefix>gml</prefix>

<uri>http://www.opengis.net/gml/3.2&lt;/uri&gt;

                                 </Namespace>

                                 <Namespace>

                                                 <prefix>town</prefix>

<uri>http://www.envitia.com/schemas/1.0&lt;/uri&gt;

                                 </Namespace>

                 </namespaces>

     <sourceDataStores>

                                 <DataStore>

<id>DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe</id>

                                                 <parameters>

                                                                 <Parameter>

                                                                                 <name>dbtype</name>

                                                                                 <value>postgis</value>

</Parameter>

                                                                 <Parameter>

                                                                                 <name>host</name>

                                                                                 <value>localhost</value>

</Parameter>

                                                                 <Parameter>

                                                                                 <name>port</name>

                                                                                 <value>MyPort</value>

</Parameter>

                                                                 <Parameter>

                                                                                 <name>database</name>

                                                                                 <value>MyDatabase</value>

</Parameter>

                                                                 <Parameter>

                                                                                 <name>user</name>

                                                                                 <value>MyUser</value>

</Parameter>

                                                                 <Parameter>

                                                                                 <name>passwd</name>

                                                                                 <value>MyPassword </value>

</Parameter>

                                                 </parameters>

                                 </DataStore>

                 </sourceDataStores>

                 <targetTypes>

                                 <FeatureType>

<schemaUri>http://test3.test2.test1/MyGMLAS.xsd&lt;/schemaUri&gt;

                                 </FeatureType>

                 </targetTypes>

     <typeMappings>

                                 <FeatureTypeMapping>

<sourceDataStore>DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe</sourceDataStore>

<sourceType>townssurvey_poly</sourceType>

<targetElement>town:TownSurvey</targetElement>

                                                 <AttributeMappings>

<AttributeMapping>

                                                                                 <targetAttribute>town:townName</targetAttribute>

                                                                                 <sourceExpression><OCQL>TOWN</OCQL></sourceExpression>

</AttributeMapping>

                                                 </AttributeMappings>

                                 </FeatureTypeMapping>

                 </typeMappings>

</as:AppSchemaDataAccess>

= = =

Error Stack Trace

= = =

java.lang.RuntimeException: Error occurred while building the resources
for the configuration page

      at
org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:302)

      at
org.geoserver.web.data.layer.NewLayerPage$6.onClick(NewLayerPage.java:241)

      at
org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:45)

      at
org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68)

      at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:177)

      at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:300)

      at
org.apache.wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:119)

      at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)

      at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1250)

      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)

      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)

      at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

      at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:484)

      at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:138)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

      at
org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:159)

      at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)

      at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

      at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)

      at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)

      at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

      at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

      at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)

      at
org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:27)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:74)

      at
org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)

      at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

      at
org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationFilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:115)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)

      at
org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:46)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)

      at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)

      at
org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:103)

      at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)

      at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)

      at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)

      at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

      at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

      at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)

      at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

      at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)

      at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)

      at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

      at org.mortbay.jetty.Server.handle(Server.java:324)

      at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

      at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828)

      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

      at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

      at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)

Caused by: org.geotools.data.DataSourceException:
http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available:
[http://www.envitia.com/schemas/1.0:TownSurvey\]

      at
org.geotools.data.complex.AppSchemaDataAccess.getMappingByElement(AppSchemaDataAccess.java:201)

      at
org.geotools.data.complex.AppSchemaDataAccess.getSchema(AppSchemaDataAccess.java:157)

      at
org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:842)

      at
org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:799)

      at
org.geoserver.catalog.impl.FeatureTypeInfoImpl.getFeatureType(FeatureTypeInfoImpl.java:87)

      at
org.geoserver.catalog.CatalogBuilder.getDefaultStyle(CatalogBuilder.java:1271)

      at
org.geoserver.catalog.CatalogBuilder.buildLayer(CatalogBuilder.java:1219)

      at
org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.java:296)

      ... 93 more

= = =

Regards,

Ryan

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

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

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

Thanks for your assistance - I have removed the app-schema layer from the web interface and changed the DataStore ID in my mapping file accordingly. I then restarted GeoServer and then attempted the following WFS requests:

1) http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=TownSurvey
2) http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=TownSurveyType
3) http://localhost:8080/geoserver/wfs?request=GetFeature&typeName=town:TownSurvey
4) http://localhost:8080/geoserver/wfs?request=GetFeature&typeName= town:TownSurveyType

Unfortunately 1) and 2) came back with the error "Could not find type name TownSurvey / TownSurveyType" and 3) and 4) returned the error "Unknown namespace [town]"

We then tried a GetCapabilities request on the WFS - this returned a valid capabilities document, but the only mention of "town" that it contained was the workspace ( xmlns:town_workspace="http://www.envitia.com/schemas/1.0&quot; )

This led me to believe that something is still misconfigured in my datastore.xml, mapping file or GML Application Schema.

Would you be able to take a quick look at the latest versions of my configuration files and let me know if you can spot any spanner in the works please?

Best Regards,

Ryan

= = =
Datastore.xml
= = =

<dataStore>
  <id>DataStoreInfoImpl-170c2841:13f1f0e2686:-7ffe</id>
  <name>town_data_source</name>
  <enabled>true</enabled>
  <workspace>
    <id>WorkspaceInfoImpl-170c2841:13f1f0e2686:-8000</id>
  </workspace>
  <connectionParameters>
    <entry key="dbtype">app-schema</entry>
    <entry key="url">file:workspaces/town_workspace/town_data_source/mapping_file.xml</entry>
    <entry key="namespace">http://www.envitia.com/schemas/1.0&lt;/entry&gt;
  </connectionParameters>
  <__default>false</__default>
</dataStore>

= = =
mapping_file.xml
= = =

<?xml version="1.0" encoding="UTF-8"?>
<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema&quot;
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd">
    <namespaces>
    <Namespace>
      <prefix>gml</prefix>
      <uri>http://www.opengis.net/gml/3.2&lt;/uri&gt;
    </Namespace>
    <Namespace>
      <prefix>town</prefix>
      <uri>http://www.envitia.com/schemas/1.0&lt;/uri&gt;
    </Namespace>
  </namespaces>
    <sourceDataStores>
    <DataStore>
      <id>MyDataStore</id>
      <parameters>
        <Parameter>
          <name>dbtype</name>
          <value>postgis</value>
        </Parameter>
        <Parameter>
          <name>host</name>
          <value>localhost</value>
        </Parameter>
        <Parameter>
          <name>port</name>
          <value>MyPort</value>
        </Parameter>
        <Parameter>
          <name>database</name>
          <value>MyDatabase</value>
        </Parameter>
        <Parameter>
          <name>user</name>
          <value>MyUser</value>
        </Parameter>
        <Parameter>
          <name>passwd</name>
          <value>MyPassword</value>
        </Parameter>
      </parameters>
    </DataStore>
  </sourceDataStores>
  <targetTypes>
    <FeatureType>
      <schemaUri>http://test3.test2.test1/MyGMLAS.xsd&lt;/schemaUri&gt;
    </FeatureType>
  </targetTypes>
    <typeMappings>
    <FeatureTypeMapping>
      <sourceDataStore>MyDataStore</sourceDataStore>
      <sourceType>townssurvey_poly</sourceType>
      <targetElement>town:TownSurvey</targetElement>
      <AttributeMappings>
        <AttributeMapping>
          <targetAttribute>town:TownSurvey</targetAttribute>
          <idExpression><OCQL>GID</OCQL></idExpression>
        </AttributeMapping>
        <AttributeMapping>
          <targetAttribute>town:townName</targetAttribute>
          <sourceExpression><OCQL>TOWN</OCQL></sourceExpression>
        </AttributeMapping>
      </AttributeMappings>
    </FeatureTypeMapping>
  </typeMappings>
</as:AppSchemaDataAccess>

= = =
MyGMLAS.xsd
= = =

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; xmlns:gml="http://www.opengis.net/gml/3.2&quot; xmlns:town="http://www.envitia.com/schemas/1.0&quot; targetNamespace="http://www.envitia.com/schemas/1.0&quot; elementFormDefault="qualified">
  <xs:import namespace="http://www.opengis.net/gml/3.2&quot; schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;/&gt;
  <xs:element name="TownSurvey" type="town:TownSurveyType" substitutionGroup="gml:AbstractFeature"/>
  <xs:complexType name="TownSurveyType">
    <xs:complexContent>
      <xs:extension base="gml:AbstractFeatureType">
        <xs:sequence>
          <xs:element name="townName" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

= = =

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@…367…]
Sent: 10 June 2013 03:16
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

Ryan,

the web administration interface does not support the app-schema plugin.
Attempting to use the web administration interface to publish app-schema layers will generate confusing and unhelpful errors. Note that the app-schema plugin *does* honour WFS service setting configured through the web interface.

Once an app-schema data store has been configured by editing files, it is available for use on the the next GeoServer restart. No administrative actions are required. Have you tried a WFS query for your type?

Note also that the DataStore/id in your mapping file is local to that file and distinct from the datastore id in datastore.xml.

Kind regards,
Ben.

On 08/06/13 00:09, Ryan Moody wrote:

Hello,

I’d be very grateful if someone could assist me with the following problem:

I’m trying to publish a GML layer whose data is sourced from a PostGIS
database and mapped to a GMLAS via the GeoServer app-schema plugin.
Unfortunately, on publishing the layer, I get the following
DataSourceException:

http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available:
[http://www.envitia.com/schemas/1.0:TownSurvey\]”

Given below are my GML Application Schema, my app-schema mapping file,
and the call stack for the DataSourceException.

Can anyone assist me in identifying the cause of the issue please?

Best Regards,

Ryan

= = =

GML Application Schema

= = =

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot;
xmlns:gml="http://www.opengis.net/gml/3.2&quot;
xmlns:town="http://www.envitia.com/schemas/1.0&quot;
targetNamespace="http://www.envitia.com/schemas/1.0&quot;
elementFormDefault="qualified">

                 <xs:import namespace="http://www.opengis.net/gml/3.2&quot;
schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;/&gt;

                 <xs:element name="TownSurvey"
type="town:TownSurveyType" substitutionGroup="gml:AbstractFeature"/>

                 <xs:complexType name="town:TownSurveyType">

                                 <xs:complexContent>

                                                 <xs:extension
base="gml:AbstractFeatureType">

<xs:sequence>

<xs:element name="townName" type="xs:string"/>

<xs:element name="townSize" type="xs:integer"/>

</xs:sequence>

                                                 </xs:extension>

                                 </xs:complexContent>

                 </xs:complexType>

</xs:schema>

= = =

Mapping File

= = =

<?xml version="1.0" encoding="UTF-8"?>

<as:AppSchemaDataAccess xmlns:as="http://www.geotools.org/app-schema&quot;

     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;

     xsi:schemaLocation="http://www.geotools.org/app-schema
AppSchemaDataAccess.xsd">

     <namespaces>

                                 <Namespace>

                                                 <prefix>gml</prefix>

<uri>http://www.opengis.net/gml/3.2&lt;/uri&gt;

                                 </Namespace>

                                 <Namespace>

                                                 <prefix>town</prefix>

<uri>http://www.envitia.com/schemas/1.0&lt;/uri&gt;

                                 </Namespace>

                 </namespaces>

     <sourceDataStores>

                                 <DataStore>

<id>DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe</id>

                                                 <parameters>

<Parameter>

<name>dbtype</name>

<value>postgis</value>

</Parameter>

<Parameter>

<name>host</name>

<value>localhost</value>

</Parameter>

<Parameter>

<name>port</name>

<value>MyPort</value>

</Parameter>

<Parameter>

<name>database</name>

<value>MyDatabase</value>

</Parameter>

<Parameter>

<name>user</name>

<value>MyUser</value>

</Parameter>

<Parameter>

<name>passwd</name>

<value>MyPassword </value>

</Parameter>

                                                 </parameters>

                                 </DataStore>

                 </sourceDataStores>

                 <targetTypes>

                                 <FeatureType>

<schemaUri>http://test3.test2.test1/MyGMLAS.xsd&lt;/schemaUri&gt;

                                 </FeatureType>

                 </targetTypes>

     <typeMappings>

                                 <FeatureTypeMapping>

<sourceDataStore>DataStoreInfoImpl-39154e6b:13ef0ec49f8:-7ffe</sourceD
ataStore>

<sourceType>townssurvey_poly</sourceType>

<targetElement>town:TownSurvey</targetElement>

                                                 <AttributeMappings>

<AttributeMapping>

<targetAttribute>town:townName</targetAttribute>

<sourceExpression><OCQL>TOWN</OCQL></sourceExpression>

</AttributeMapping>

                                                 </AttributeMappings>

                                 </FeatureTypeMapping>

                 </typeMappings>

</as:AppSchemaDataAccess>

= = =

Error Stack Trace

= = =

java.lang.RuntimeException: Error occurred while building the
resources for the configuration page

      at
org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.
java:302)

      at
org.geoserver.web.data.layer.NewLayerPage$6.onClick(NewLayerPage.java:
241)

      at
org.geoserver.web.wicket.SimpleAjaxLink$1.onClick(SimpleAjaxLink.java:
45)

      at
org.apache.wicket.ajax.markup.html.AjaxLink$1.onEvent(AjaxLink.java:68
)

      at
org.apache.wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.jav
a:177)

      at
org.apache.wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractD
efaultAjaxBehavior.java:300)

      at
org.apache.wicket.request.target.component.listener.BehaviorRequestTar
get.processEvents(BehaviorRequestTarget.java:119)

      at
org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(
AbstractRequestCycleProcessor.java:92)

      at
org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.ja
va:1250)

      at org.apache.wicket.RequestCycle.step(RequestCycle.java:1329)

      at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1436)

      at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)

      at
org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:4
84)

      at
org.apache.wicket.protocol.http.WicketServlet.doGet(WicketServlet.java
:138)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

      at
org.springframework.web.servlet.mvc.ServletWrappingController.handleRe
questInternal(ServletWrappingController.java:159)

      at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(A
bstractController.java:153)

      at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.han
dle(SimpleControllerHandlerAdapter.java:48)

      at
org.springframework.web.servlet.DispatcherServlet.doDispatch(Dispatche
rServlet.java:923)

      at
org.springframework.web.servlet.DispatcherServlet.doService(Dispatcher
Servlet.java:852)

      at
org.springframework.web.servlet.FrameworkServlet.processRequest(Framew
orkServlet.java:882)

      at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServle
t.java:778)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

      at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1093)

      at
org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsC
leanupFilter.java:27)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDele
gatingFilter.java:74)

      at
org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegating
Filter.java:45)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatc
hFilter.java:49)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetChar
acterEncodingFilter.java:109)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:311)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.access.intercept.FilterSecurityInterc
eptor.invoke(FilterSecurityInterceptor.java:116)

      at
org.springframework.security.web.access.intercept.FilterSecurityInterc
eptor.doFilter(FilterSecurityInterceptor.java:83)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoSer
verCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.access.ExceptionTranslationFilter.doF
ilter(ExceptionTranslationFilter.java:113)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoSer
verCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.d
oFilter(GeoServerAnonymousAuthenticationFilter.java:53)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.authentication.AbstractAuthentication
ProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:
182)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoSer
verCompositeFilter.java:91)

      at
org.geoserver.security.filter.GeoServerUserNamePasswordAuthenticationF
ilter.doFilter(GeoServerUserNamePasswordAuthenticationFilter.java:115)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.authentication.rememberme.RememberMeA
uthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:146)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoSer
verCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:68)

      at
org.springframework.security.web.context.SecurityContextPersistenceFil
ter.doFilter(SecurityContextPersistenceFilter.java:87)

      at
org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilte
r$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:46)

      at
org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterCha
in.doFilter(GeoServerCompositeFilter.java:72)

      at
org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoSer
verCompositeFilter.java:91)

      at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.d
oFilter(FilterChainProxy.java:323)

      at
org.springframework.security.web.FilterChainProxy.doFilter(FilterChain
Proxy.java:173)

      at
org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoS
erverSecurityFilterChainProxy.java:103)

      at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(De
legatingFilterProxy.java:346)

      at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(Delegati
ngFilterProxy.java:259)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.j
ava:47)

      at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletH
andler.java:1084)

      at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:36
0)

      at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java
:216)

      at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:18
1)

      at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:72
6)

      at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

      at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandl
erCollection.java:206)

      at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.j
ava:114)

      at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:15
2)

      at org.mortbay.jetty.Server.handle(Server.java:324)

      at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505
)

      at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpCon
nection.java:828)

      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

      at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

      at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

      at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.jav
a:395)

      at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.
java:450)

Caused by: org.geotools.data.DataSourceException:
http://www.envitia.com/schemas/1.0:TownSurveyType not found. Available:
[http://www.envitia.com/schemas/1.0:TownSurvey\]

      at
org.geotools.data.complex.AppSchemaDataAccess.getMappingByElement(AppS
chemaDataAccess.java:201)

      at
org.geotools.data.complex.AppSchemaDataAccess.getSchema(AppSchemaDataA
ccess.java:157)

      at
org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:84
2)

      at
org.geoserver.catalog.ResourcePool.getFeatureType(ResourcePool.java:79
9)

      at
org.geoserver.catalog.impl.FeatureTypeInfoImpl.getFeatureType(FeatureT
ypeInfoImpl.java:87)

      at
org.geoserver.catalog.CatalogBuilder.getDefaultStyle(CatalogBuilder.ja
va:1271)

      at
org.geoserver.catalog.CatalogBuilder.buildLayer(CatalogBuilder.java:12
19)

      at
org.geoserver.web.data.layer.NewLayerPage.buildLayerInfo(NewLayerPage.
java:296)

      ... 93 more

= = =

Regards,

Ryan

----------------------------------------------------------------------
-------- How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations 2.
Dashboards that offer high-level views of enterprise services 3. A
single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

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

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...367...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

Ryan,

I think you have defined a namespace called "town_workspace", which is not what you want. Please check your workspace folder layout and your namespace.xml (and its namespace/prefix) and workspace.xml (and its workspace/name).

Kind regards,
Ben.

On 10/06/13 17:23, Ryan Moody wrote:

We then tried a GetCapabilities request on the WFS - this returned a valid capabilities document, but the only mention of "town" that it contained was the workspace ( xmlns:town_workspace="http://www.envitia.com/schemas/1.0&quot; )

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

Thanks again - I have checked my workspace.xml and namespace.xml and have updated them to use the "town" prefix. I also realised that I needed a TownSurvey directory and a corresponding featuretype.xml underneath my data store directory in order for it to be picked up in the GetCapabilities document.

I then tried the following WFS request:

http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&maxFeatures=2&typeName=town:TownSurvey

Which gave me back the following response:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:FeatureCollection xmlns:wfs="http://www.opengis.net/wfs&quot; xmlns:ogc="http://www.opengis.net/ogc&quot; xmlns:tiger="http://www.census.gov" xmlns:cite="http://www.opengeospatial.net/cite&quot; xmlns:nurc="http://www.nurc.nato.int" xmlns:sde="http://geoserver.sf.net" xmlns:topp="http://www.openplans.org/topp&quot; xmlns:town="http://www.envitia.com/schemas/1.0&quot; xmlns:it.geosolutions="http://www.geo-solutions.it" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:sf="http://www.openplans.org/spearfish&quot; xmlns:ows="http://www.opengis.net/ows&quot; xmlns:gml="http://www.opengis.net/gml&quot; xmlns:xlink="http://www.w3.org/1999/xlink&quot; numberOfFeatures="2" timeStamp="2013-06-10T11:10:31.990Z" xsi:schemaLocation="http://www.envitia.com/schemas/1.0 http://test3.test2.test1/MyGMLAS.xsd http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
  <gml:featureMember>
    <town:TownSurvey gml:id="townssurvey_poly.1"/>
  </gml:featureMember>
  <gml:featureMember>
    <town:TownSurvey gml:id="townssurvey_poly.2"/>
  </gml:featureMember>
</wfs:FeatureCollection>

This is progress, but I noticed that only the ID was being mapped - the town name was not being mapped. Referring back to extracts of my latest mapping file and my GML Application Schema, I have entries for "townName" as shown below. I have confirmed that TOWN is a character column in my PostGIS database, and I have tried various combinations of AttributeMappings that unfortunately haven't worked.

If you have a spare moment, would you be able to advise me as to where I'm going wrong please?

Many thanks for your support so far, it's much appreciated :slight_smile:

Ryan

= = =
Mapping File (Attempt 1)
= = =

<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression><OCQL>TOWN</OCQL></sourceExpression>
</AttributeMapping>

= = =
Mapping File (Attempt 2)
= = =

<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression>"test"</sourceExpression>
</AttributeMapping>

= = =
Mapping File (Attempt 3)
= = =

<AttributeMapping>
  <targetAttribute>town:TownSurvey/townName</targetAttribute>
  <sourceExpression>"test"</sourceExpression>
</AttributeMapping>

= = =
GML Application Schema
= = =

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema&quot; xmlns:gml="http://www.opengis.net/gml/3.2&quot; xmlns:town="http://www.envitia.com/schemas/1.0&quot; targetNamespace="http://www.envitia.com/schemas/1.0&quot; elementFormDefault="qualified">
  <xs:import namespace="http://www.opengis.net/gml/3.2&quot; schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;/&gt;
  <xs:element name="TownSurvey" type="town:TownSurveyType" substitutionGroup="gml:AbstractFeature"/>
  <xs:complexType name="TownSurveyType">
    <xs:complexContent>
      <xs:extension base="gml:AbstractFeatureType">
        <xs:sequence>
          <xs:element name="townName" type="xs:string"/>
        </xs:sequence>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
</xs:schema>

= = =

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@…367…]
Sent: 10 June 2013 10:29
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

Ryan,

I think you have defined a namespace called "town_workspace", which is not what you want. Please check your workspace folder layout and your namespace.xml (and its namespace/prefix) and workspace.xml (and its workspace/name).

Kind regards,
Ben.

On 10/06/13 17:23, Ryan Moody wrote:

We then tried a GetCapabilities request on the WFS - this returned a
valid capabilities document, but the only mention of "town" that it
contained was the workspace (
xmlns:town_workspace="http://www.envitia.com/schemas/1.0&quot; )

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...367...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

On 10/06/13 19:38, Ryan Moody wrote:

This is progress, but I noticed that only the ID was being mapped - the town name was not being mapped. Referring back to extracts of my latest mapping file and my GML Application Schema, I have entries for "townName" as shown below. I have confirmed that TOWN is a character column in my PostGIS database, and I have tried various combinations of AttributeMappings that unfortunately haven't worked.

[...]

= = =
Mapping File (Attempt 1)
= = =
<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression><OCQL>TOWN</OCQL></sourceExpression>
</AttributeMapping>

Almost right. PostGIS identifiers should be lowercase; unless you really, really defined your table with 'create table "TOWN" ...' in PostGIS (and I have seen this particular insanity), names are stored in lowercase. You should be able to make this work by changing it to:
<sourceExpression><OCQL>town</OCQL></sourceExpression>

See: http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#database-identifiers

= = =
Mapping File (Attempt 2)
= = =

<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression>"test"</sourceExpression>
</AttributeMapping>

Invalid as you have no <OCQL> enclosing your literal; a validating XML editor should warn you about this. The nonvalidating parser that reads the mapping file see you have no <OCQL> and ignores the extraneous content. Furthermore, CQL literal strings are delimited with single (') not double (") quotes. You should be able to make this work by changing it to:
<sourceExpression><OCQL>'test'</OCQL></sourceExpression>

(Attempt 3 is a variation on this. I prefer 2 as it has namespace prefixes and omits redundant information.)

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

Thanks for your assistance - I tried using lowercase identifiers as described in Attempt 1, and using <OCQL>'test'</OCQL> as described in Attempt 2, but unfortunately I'm still not getting the townName data coming through in the WFS response.

Can you confirm that my GML Application Schema (below) has the townName correctly configured please? Is there anything else that I should verify that may be relevant to getting the townName mapping working?

Many thanks,

Ryan

= = =
GML Application Schema
= = =

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema&quot; xmlns:gml="http://www.opengis.net/gml/3.2&quot; xmlns:town="http://www.envitia.com/schemas/1.0&quot; targetNamespace="http://www.envitia.com/schemas/1.0&quot; elementFormDefault="qualified">
  <xsd:import namespace="http://www.opengis.net/gml/3.2&quot; schemaLocation="http://schemas.opengis.net/gml/3.2.1/gml.xsd&quot;/&gt;
  <xsd:element name="TownSurvey" type="town:TownSurveyType" substitutionGroup="gml:AbstractFeature"/>
  <xsd:complexType name="TownSurveyType">
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractFeatureType">
        <xsd:sequence>
          <xsd:element name="townName" type="xsd:string"/>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
</xsd:schema>

= = =

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@…367…]
Sent: 11 June 2013 03:02
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

On 10/06/13 19:38, Ryan Moody wrote:

This is progress, but I noticed that only the ID was being mapped - the town name was not being mapped. Referring back to extracts of my latest mapping file and my GML Application Schema, I have entries for "townName" as shown below. I have confirmed that TOWN is a character column in my PostGIS database, and I have tried various combinations of AttributeMappings that unfortunately haven't worked.

[...]

= = =
Mapping File (Attempt 1)
= = =
<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression><OCQL>TOWN</OCQL></sourceExpression>
</AttributeMapping>

Almost right. PostGIS identifiers should be lowercase; unless you really, really defined your table with 'create table "TOWN" ...' in PostGIS (and I have seen this particular insanity), names are stored in lowercase. You should be able to make this work by changing it to:
<sourceExpression><OCQL>town</OCQL></sourceExpression>

See:
http://docs.geoserver.org/latest/en/user/data/app-schema/mapping-file.html#database-identifiers

= = =
Mapping File (Attempt 2)
= = =

<AttributeMapping>
  <targetAttribute>town:townName</targetAttribute>
  <sourceExpression>"test"</sourceExpression>
</AttributeMapping>

Invalid as you have no <OCQL> enclosing your literal; a validating XML editor should warn you about this. The nonvalidating parser that reads the mapping file see you have no <OCQL> and ignores the extraneous content. Furthermore, CQL literal strings are delimited with single (') not double (") quotes. You should be able to make this work by changing it to:
<sourceExpression><OCQL>'test'</OCQL></sourceExpression>

(Attempt 3 is a variation on this. I prefer 2 as it has namespace prefixes and omits redundant information.)

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...367...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

Aha! Ryan, your application schema is GML 3.2.1, but your test request is for WFS 1.1.0, which defaults to GML 3.1.1. These two GML versions have different definitions of a feature. This will cause Bad Things To Happen.

To get a GML 3.2.1 response you can either:

(1) Use WFS version=1.1.0 and outputFormat=gml32, or

(2) Use WFS version=2.0.0 (currently the default.

See: http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

I've kept the GMLAS as shown in my previous email (version 3.2.1) and attempted the following WFS requests:

1) http://localhost:8080/geoserver/wfs?request=GetFeature&maxFeatures=2&typeName=town:TownSurvey
2) http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=gml32&maxFeatures=2&typeName=town:TownSurvey
3) http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&maxFeatures=2&typeName=town:TownSurvey
4) http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&outputFormat=gml32&maxFeatures=2&typeName=town:TownSurvey

I've also created the GML 3.2.1 secondary namespace as described in the link you sent me, and I already have an AttributeMapping for the gml:id in my mapping file.

Unfortunately, I'm still not getting the townName data in the WFS response - is there anything else I may have overlooked?

Furthermore, I noticed that the maxFeatures parameter is ignored when the version is set to 2.0.0 - is that expected?

Many thanks,

Ryan

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@…367…]
Sent: 11 June 2013 09:49
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

Aha! Ryan, your application schema is GML 3.2.1, but your test request is for WFS 1.1.0, which defaults to GML 3.1.1. These two GML versions have different definitions of a feature. This will cause Bad Things To Happen.

To get a GML 3.2.1 response you can either:

(1) Use WFS version=1.1.0 and outputFormat=gml32, or

(2) Use WFS version=2.0.0 (currently the default.

See:
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...367...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

Ryan,

WFS 2.0.0 has count instead of maxFeatures and typeNames instead of typeName (but GeoServer is permissive of the latter). outputFormat=gml32 is not needed withWFS 2.0.0 as this is the default.

Still thinking ...

Kind regards,
Ben.

On 11/06/13 17:24, Ryan Moody wrote:

Hi Ben,

I've kept the GMLAS as shown in my previous email (version 3.2.1) and attempted the following WFS requests:

1) http://localhost:8080/geoserver/wfs?request=GetFeature&maxFeatures=2&typeName=town:TownSurvey
2) http://localhost:8080/geoserver/wfs?request=GetFeature&version=1.1.0&outputFormat=gml32&maxFeatures=2&typeName=town:TownSurvey
3) http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&maxFeatures=2&typeName=town:TownSurvey
4) http://localhost:8080/geoserver/wfs?request=GetFeature&version=2.0.0&outputFormat=gml32&maxFeatures=2&typeName=town:TownSurvey

I've also created the GML 3.2.1 secondary namespace as described in the link you sent me, and I already have an AttributeMapping for the gml:id in my mapping file.

Unfortunately, I'm still not getting the townName data in the WFS response - is there anything else I may have overlooked?

Furthermore, I noticed that the maxFeatures parameter is ignored when the version is set to 2.0.0 - is that expected?

Many thanks,

Ryan

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@anonymised.com]
Sent: 11 June 2013 09:49
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

Aha! Ryan, your application schema is GML 3.2.1, but your test request is for WFS 1.1.0, which defaults to GML 3.1.1. These two GML versions have different definitions of a feature. This will cause Bad Things To Happen.

To get a GML 3.2.1 response you can either:

(1) Use WFS version=1.1.0 and outputFormat=gml32, or

(2) Use WFS version=2.0.0 (currently the default.

See:
http://docs.geoserver.org/latest/en/user/data/app-schema/supported-gml-versions.html

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Found it.

I pasted the entirety of your original mapping file into a validating XML editor (Eclipse JEE) with AppSchemaDataAccess.xsd in the same directory. Your mapping file is schema-invalid because of a misspelled element:

<AttributeMappings> should be <attributeMappings>

Because the mapping file parser is nonvalidating and only looks for child elements of <attributeMappings> and finds none, your mapping is ignored, resulting in a lack of content.

I strongly recommend the use of a validating XML editor for correctness and helpful documentation and completion suggestions when editing.

Kind regards,
Ben.

On 11/06/13 17:41, Ben Caradoc-Davies wrote:

Still thinking ...

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

On Wed, Jun 12, 2013 at 4:19 AM, Ben Caradoc-Davies <
Ben.Caradoc-Davies@anonymised.com> wrote:

Found it.

I pasted the entirety of your original mapping file into a validating
XML editor (Eclipse JEE) with AppSchemaDataAccess.xsd in the same
directory. Your mapping file is schema-invalid because of a misspelled
element:

<AttributeMappings> should be <attributeMappings>

Because the mapping file parser is nonvalidating and only looks for
child elements of <attributeMappings> and finds none, your mapping is
ignored, resulting in a lack of content.

I strongly recommend the use of a validating XML editor for correctness
and helpful documentation and completion suggestions when editing.

Ben, is the mapping document read only once by the app schema store, and
then used over and over, or does it have to read it on a per request basis?
If it's the former, why not activate schema validation during the read and
report
errors accordingly?

Many people use simple text editors to do all their editing, including XML,
I've already searched in the past for some light weight editor that also has
schema validation and auto completion support, but could not find one...
Just stumbled into this one now:
http://en.wikipedia.org/wiki/Comparison_of_XML_editors
Haven't tried but this one looks like an interesting solution that I did
not know about:
http://xml-copy-editor.sourceforge.net/index.php?page=ubuntu

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------

On 12/06/13 14:02, Andrea Aime wrote:

Ben, is the mapping document read only once by the app schema store, and
then used over and over, or does it have to read it on a per request basis?
If it's the former, why not activate schema validation during the read
and report errors accordingly?

The mapping file is read once at startup. There is no reason not to replace it with a validating parser. It currently uses Apache Digester, as in the original community-schemas plugin in 2006.

There is also a problem with the schema, which mistakenly fails to use elementFormDefault="qualified", leaving all the elements defined in the complexTypes in the null namespace. This fails to conform to W3 Web Architecture best practice.

Many people use simple text editors to do all their editing, including XML

Me too. I often edit pom files with gedit.

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre

Hi Ben,

Many thanks! I discovered that I had to make some additional changes to the mapping file on top of the spelling correction ( setting Expose primary keys = true and changing the names of the target attributes under the type mappings ), but I finally have the town names coming through in the WFS request! We use XMLSpy as our validating XML Editor - however I had only used it to validate our GML application schema, it didn't occur to me that I could also use it to validate our mapping file!

Thanks again for your assistance, I will most likely be in touch again once I attempt some more complicated mappings :slight_smile:

Best Regards,

Ryan

-----Original Message-----
From: Ben Caradoc-Davies [mailto:Ben.Caradoc-Davies@…367…]
Sent: 12 June 2013 03:20
To: Ryan Moody
Cc: geoserver-users@lists.sourceforge.net; Ian Turton; Neil Kirk
Subject: Re: [Geoserver-users] App-Schema Publish Layer Exception

Found it.

I pasted the entirety of your original mapping file into a validating XML editor (Eclipse JEE) with AppSchemaDataAccess.xsd in the same directory. Your mapping file is schema-invalid because of a misspelled
element:

<AttributeMappings> should be <attributeMappings>

Because the mapping file parser is nonvalidating and only looks for child elements of <attributeMappings> and finds none, your mapping is ignored, resulting in a lack of content.

I strongly recommend the use of a validating XML editor for correctness and helpful documentation and completion suggestions when editing.

Kind regards,
Ben.

On 11/06/13 17:41, Ben Caradoc-Davies wrote:

Still thinking ...

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@...367...> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre

jEdit with the XML plugin might also be worth looking into. Contrary to the wikipedia page, it does have auto-completion for elements with XSD completion.

···

On Wed, Jun 12, 2013 at 2:02 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Jun 12, 2013 at 4:19 AM, Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com> wrote:


This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Found it.

I pasted the entirety of your original mapping file into a validating
XML editor (Eclipse JEE) with AppSchemaDataAccess.xsd in the same
directory. Your mapping file is schema-invalid because of a misspelled
element:

should be

Because the mapping file parser is nonvalidating and only looks for
child elements of and finds none, your mapping is
ignored, resulting in a lack of content.

I strongly recommend the use of a validating XML editor for correctness
and helpful documentation and completion suggestions when editing.

Ben, is the mapping document read only once by the app schema store, and
then used over and over, or does it have to read it on a per request basis?
If it’s the former, why not activate schema validation during the read and report
errors accordingly?

Many people use simple text editors to do all their editing, including XML,
I’ve already searched in the past for some light weight editor that also has
schema validation and auto completion support, but could not find one…
Just stumbled into this one now:
http://en.wikipedia.org/wiki/Comparison_of_XML_editors

Haven’t tried but this one looks like an interesting solution that I did not know about:
http://xml-copy-editor.sourceforge.net/index.php?page=ubuntu

Cheers
Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more information.

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it