null pointer exception on getFeature with stored query on workspace endpoint

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)

Environment

None

Activity

Show:
Andrea Aime
May 23, 2016, 5:01 PM

Ciao Angelo, right now all developers are focusing their efforts on getting 2.9.0 released, so I would not hold my breath on this one.

Angelo Quaglia
May 30, 2016, 8:08 AM

Ciao Andrea, many thanks for the update.
That is good to know.
Unfortunately, all of Malta's INSPIRE WFS services are not working because of this issue.
Do you have any pointer that could help their investigation?
Do you think this is a setup issue or a genuine bug? (For sure, the nasty message is a bug but a minor one)
Do you think the GeoServer Community might be of help?

Andrea Aime
May 30, 2016, 8:14 AM

Looks like a genuine bug to me. About helping, the spare time of current developers has weathered down to zero during the last years (more demanding jobs, families, the size of the dev team remaining pretty much the same while the user community exploded, etc). If you need a fix quickly (e.g., not waiting a few months or more) you should either look at building one of your own, or checking commercial support here: http://geoserver.org/support/

Alvaro Huarte
June 21, 2017, 8:29 AM
Edited

Hi Angelo, I have got same issues. I changed some code to fix these errors.
Now, we have succesfully validated the WMS and WFS services with the INSPIRE validator.

If you already have not fixed it, I share my changes in GeoServer code:
+ WFSWorkspaceQualifier error
+ StoredQuery error

I hope this help you.
Best regards

Angelo Quaglia
June 21, 2017, 9:04 AM

Dear Alvaro,
many thanks.

I have notified Malta's representative (https://ies-svn.jrc.ec.europa.eu/issues/2770) even though I think they have switched to some other implementation by now.

Best regards,
Angelo

Fixed

Assignee

Andrea Aime

Reporter

Angelo Quaglia

Triage

None

Fix versions

Affects versions

Components

Priority

Medium