Uploaded image for project: 'GeoServer'
  1. GEOS-7532

null pointer exception on getFeature with stored query on workspace endpoint

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 2.7.3, 2.8.3, 2.9-RC1
    • Fix Version/s: 2.13-beta
    • Component/s: WFS
    • Labels:

      Description

      Steps to reproduce:

      Fresh install of 2.8.3 and 2.9-RC1 on the Mac

      <?xml version="1.0" encoding="UTF-8"?>
      <wfs:CreateStoredQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd"
      xmlns:fes="http://www.opengis.org/fes/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" service="WFS" version="2.0.0"
      xmlns:topp="http://www.openplans.org/topp">
      <wfs:StoredQueryDefinition id="test">
      <wfs:QueryExpressionText returnFeatureTypes='topp:tasmania_cities' isPrivate='false'>
      <wfs:Query typeNames="topp:tasmania_cities" >
      </wfs:Query>
      </wfs:QueryExpressionText>
      </wfs:StoredQueryDefinition>
      </wfs:CreateStoredQuery>

      I get:

      <ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">

      <ows:Exception exceptionCode="OperationParsingFailed">
      <ows:ExceptionText>Request parsing failed
      [Assertion failed] - this argument is required; it must not be null</ows:ExceptionText>

      </ows:Exception>
      </ows:ExceptionReport>

      I remove the filter chains in the settings and the CreateStoredQuery works:

      <wfs:CreateStoredQueryResponse xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fes="http://www.opengis.net/fes/2.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" status="OK" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8080/geoserver/schemas/wfs/2.0/wfs.xsd"/>

      If I get:

      http://localhost:8080/geoserver/ows?request=GetFeature&service=WFS&version=2.0.0&STOREDQUERY_ID=test

      I get the correct answer:

      <?xml version="1.0" encoding="UTF-8"?>
      <wfs:FeatureCollection xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:topp="http://www.openplans.org/topp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" numberMatched="1" numberReturned="1" timeStamp="2016-05-06T10:39:00.729Z" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://localhost:8080/geoserver/schemas/wfs/2.0/wfs.xsd http://www.openplans.org/topp http://localhost:8080/geoserver/wfs?service=WFS&amp;version=2.0.0&amp;request=DescribeFeatureType&amp;typeName=topp%3Atasmania_cities http://www.opengis.net/gml/3.2 http://localhost:8080/geoserver/schemas/gml/3.2.1/gml.xsd">
      <wfs:member>
      <topp:tasmania_cities gml:id="tasmania_cities.1">
      <topp:the_geom>
      ...

      However, when I add the workspace qualifier to the url:

      http://localhost:8080/geoserver/topp/ows?request=GetFeature&service=WFS&version=2.0.0&STOREDQUERY_ID=test

      I get

      <ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/owsAll.xsd">
      <ows:Exception exceptionCode="NoApplicableCode">
      <ows:ExceptionText>java.lang.NullPointerException</ows:ExceptionText>

      </ows:Exception>
      </ows:ExceptionReport>

      the server log says:

      Request: getServiceInfo
      06 May 12:34:04 ERROR [geoserver.ows] -
      java.lang.NullPointerException
      at org.geoserver.wfs.WFSWorkspaceQualifier.qualifyTypeNames(WFSWorkspaceQualifier.java:192)
      at org.geoserver.wfs.WFSWorkspaceQualifier.qualifyRequest(WFSWorkspaceQualifier.java:135)
      at org.geoserver.ows.WorkspaceQualifyingCallback.operationDispatched(WorkspaceQualifyingCallback.java:51)
      at org.geoserver.ows.Dispatcher.fireOperationDispatchedCallback(Dispatcher.java:795)
      at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:790)
      at org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:258)
      at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:147)
      at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
      at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
      at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
      at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:968)
      at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:859)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
      at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:844)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      at org.geoserver.filters.ThreadLocalsCleanupFilter.doFilter(ThreadLocalsCleanupFilter.java:28)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:75)
      at org.geoserver.wms.animate.AnimatorFilter.doFilter(AnimatorFilter.java:71)
      at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:71)
      at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:46)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:207)
      at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
      at org.geoserver.security.GeoServerSecurityFilterChainProxy.doFilter(GeoServerSecurityFilterChainProxy.java:152)
      at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
      at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:87)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
      at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      at org.eclipse.jetty.server.Server.handle(Server.java:499)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
      at java.lang.Thread.run(Thread.java:745)

        Attachments

          Activity

            People

            • Assignee:
              aaime Andrea Aime
              Reporter:
              aquaglia Angelo Quaglia
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Stride room