GeoServer

Sorting WFS 1.1.0 cite tests broken

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.6.4, 1.7.0-beta1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

The following cite request:
http://87.6.39.202:8080/geoserver/wfs?&service=WFS&version=1.1.0&request=GetFeature&typename=sf:PrimitiveGeoFeature&sortby=sf%3AintProperty&namespace=xmlns(sf=http://cite.opengeospatial.org/gmlsf)

breaks with the following exception:

19 mag 10:54:24 WARN [geoserver.ows] - 
org.geoserver.wfs.WFSException: Error occurred getting features
	at org.geoserver.wfs.GetFeature.run(GetFeature.java:284)
	at org.geoserver.wfs.DefaultWebFeatureService.getFeature(DefaultWebFeatureService.java:108)
	at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:292)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:155)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:122)
	at org.geoserver.wfs.WFSLogger.invoke(WFSLogger.java:44)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:174)
	at $Proxy0.getFeature(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor81.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.geoserver.security.OperationSecurityInterceptor.invoke(OperationSecurityInterceptor.java:41)
	at org.geoserver.ows.Dispatcher.execute(Dispatcher.java:509)
	at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:188)
	at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:139)
	at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:44)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:684)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:625)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:392)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:347)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:459)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1054)
	at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
	at org.geoserver.filters.ReverseProxyFilter.doFilter(ReverseProxyFilter.java:170)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
	at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:73)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
	at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:47)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:264)
	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
	at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:110)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:178)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:229)
	at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:274)
	at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:148)
	at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
	at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1045)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:358)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:231)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:629)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:453)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
	at org.mortbay.jetty.Server.handle(Server.java:303)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:452)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:721)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:509)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:349)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:217)
	at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)
Caused by: org.geotools.data.DataSourceException: DataStore cannot provide the requested sort order
	at org.vfny.geoserver.global.GeoServerFeatureSource.getFeatures(GeoServerFeatureSource.java:324)
	at org.geoserver.wfs.GetFeature.getFeatures(GetFeature.java:347)
	at org.geoserver.wfs.GetFeature.run(GetFeature.java:259)
	... 63 more
Caused by: org.geotools.data.DataSourceException: DataStore cannot provide the requested sort order
	at org.geotools.data.jdbc.JDBCFeatureSource.getFeatures(JDBCFeatureSource.java:214)
	at org.vfny.geoserver.global.GeoServerFeatureSource.getFeatures(GeoServerFeatureSource.java:320)
	... 65 more

Issue Links

Activity

Hide
Andrea Aime added a comment -

This is due to a check for sortability on a certain attribute. The attribute name comes directly from the WFS request and it's namespace prefixed (sf:intProperty) whilst the feature type knows only about the non prefixed version (intProperty).
The capabilities support for postgis does the following to extract the property name:
sortBy.getPropertyName().getPropertyName(); -> sf:intProperty
whilst the sql encoder, that already supported proper extraction of the name, uses something like:

AttributeType type = (AttributeType) sortAttribute.getPropertyName()
                        .evaluate(ft);
                if (type != null) {
                    sql.append(encoder.escapeName(type.getLocalName()));
                } else {
                    sql.append(encoder
                            .escapeName(sortAttribute.getPropertyName().getPropertyName()));
                }

That is, it first evaluates the property name against the feature type, and that usually succeeds returning a non null AttributeType, with the result that the second path is not usually executed.
My first reaction was, why don't we clean up the prefixes before feeding the attributes into the GT2 datastores? Yet, on second thought this seems around to provide support, in the future, for namespaced attributes.... is this correct?

Show
Andrea Aime added a comment - This is due to a check for sortability on a certain attribute. The attribute name comes directly from the WFS request and it's namespace prefixed (sf:intProperty) whilst the feature type knows only about the non prefixed version (intProperty). The capabilities support for postgis does the following to extract the property name: sortBy.getPropertyName().getPropertyName(); -> sf:intProperty whilst the sql encoder, that already supported proper extraction of the name, uses something like:
AttributeType type = (AttributeType) sortAttribute.getPropertyName()
                        .evaluate(ft);
                if (type != null) {
                    sql.append(encoder.escapeName(type.getLocalName()));
                } else {
                    sql.append(encoder
                            .escapeName(sortAttribute.getPropertyName().getPropertyName()));
                }
That is, it first evaluates the property name against the feature type, and that usually succeeds returning a non null AttributeType, with the result that the second path is not usually executed. My first reaction was, why don't we clean up the prefixes before feeding the attributes into the GT2 datastores? Yet, on second thought this seems around to provide support, in the future, for namespaced attributes.... is this correct?
Hide
Gabriel Roldán added a comment -

okay, thanks Andrea for the detailed report. The geotools issue is fixed, gonna wait for the cite results to close this one

Show
Gabriel Roldán added a comment - okay, thanks Andrea for the detailed report. The geotools issue is fixed, gonna wait for the cite results to close this one
Hide
Andrea Aime added a comment -

Run WFS 1.1.0 cite tests again, all pass, nicely done.

Show
Andrea Aime added a comment - Run WFS 1.1.0 cite tests again, all pass, nicely done.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: