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" ) 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</entry> </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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.geotools.org/app-schema AppSchemaDataAccess.xsd"> <namespaces> <Namespace> <prefix>gml</prefix> <uri>http://www.opengis.net/gml/3.2</uri> </Namespace> <Namespace> <prefix>town</prefix> <uri>http://www.envitia.com/schemas/1.0</uri> </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</schemaUri> </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" 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="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:[email protected]] Sent: 10 June 2013 03:16 To: Ryan Moody Cc: [email protected]; 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" > 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"> > > <namespaces> > > <Namespace> > > <prefix>gml</prefix> > > > <uri>http://www.opengis.net/gml/3.2</uri> > > </Namespace> > > <Namespace> > > <prefix>town</prefix> > > > <uri>http://www.envitia.com/schemas/1.0</uri> > > </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</schemaUri> > > </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 > [email protected] > https://lists.sourceforge.net/lists/listinfo/geoserver-users > -- Ben Caradoc-Davies <[email protected]> Software Engineer CSIRO Earth Science and Resource Engineering Australian Resources Research Centre ------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/geoserver-users
