Hi,

I just added an issue to the tracker for this, in case someone wants to
follow the progress: https://osgeo-org.atlassian.net/browse/GEOS-7391

Cheers.

2016-01-19 10:12 GMT+01:00 Víctor González <victor.gonza...@geomati.co>:

> Hi,
>
> I found a problem with WFS GetFeature requests returning a NPE (see
> exception below). These conditions must occur at the same time for the
> problem to appear:
>
> * There must be a data rule that allows an entire workspace only for a
> specific role (for example, sf.*.r: myrole).
> * There must be a data rule that allows a single layer in that workspace
> for any role (sf.roads.r: *).
> * The first WFS request that arrives to the server must come from a user
> that doesn't have the role described in the first condition.
>
> You can reproduce it with the following data_dir (tested on GeoServer
> 2.8.1): https://www.dropbox.com/s/gdkmht7hsipgcg9/data_dir.tar.gz?dl=0.
> Performing this request:
>
> curl -X POST "http://localhost:8080/geoserver/wfs"; -d @/tmp/payload.xml
> -H "Content-Type: application/xml; charset=UTF-8"
>
> with this payload.xml:
>
> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"; service="WFS"
> version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";><wfs:Query
> typeName="feature:tiger_roads" xmlns:feature="http://www.census.gov"/
> ></wfs:GetFeature>
>
> The problem comes because the XML schema for the WFS request has not been
> obtained previously and the user that performs the request doesn't have
> permissions to see the workspace (even though it can see a specific layer
> within that workspace). It doesn't happen after the admin user (or any
> other user that can see all layers) performs a WFS request and the schema
> is built successfully.
>
> What I'm trying to do is to secure all layers in a workspace except from
> one. Am I doing something wrong or is this a bug in GeoServer?
>
> Best regards.
>
> ---
>
> java.lang.NullPointerException
>     at
> org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.buildSchemaInternal(FeatureTypeSchemaBuilder.java:194)
>     at
> org.geoserver.wfs.xml.FeatureTypeSchemaBuilder.addApplicationTypes(FeatureTypeSchemaBuilder.java:503)
>     at org.geoserver.wfs.xml.v1_0_0.WFS.buildSchema(WFS.java:231)
>     at org.geotools.xml.XSD.getSchema(XSD.java:232)
>     at org.geotools.xml.SchemaLocator.locateSchema(SchemaLocator.java:96)
>     at
> org.geotools.xml.impl.ParserHandler.startElement(ParserHandler.java:404)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:614)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3135)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:880)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
>     at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
>     at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
>     at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
>     at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
>     at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
>     at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:642)
>     at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:326)
>     at org.geotools.xml.Parser.parse(Parser.java:240)
>     at org.geotools.xml.Parser.parse(Parser.java:188)
>     at org.geoserver.wfs.xml.v1_0_0.WfsXmlReader.read(WfsXmlReader.java:79)
>     at org.geoserver.ows.Dispatcher.parseRequestXML(Dispatcher.java:1553)
>     at org.geoserver.ows.Dispatcher.dispatch(Dispatcher.java:691)
>     at
> org.geoserver.ows.Dispatcher.handleRequestInternal(Dispatcher.java:265)
>     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.doPost(FrameworkServlet.java:789)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>     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:28)
>     at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     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.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     at
> org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:50)
>     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:69)
>     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:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>     at
> org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:54)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:201)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     at
> org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:83)
>     at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:69)
>     at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>     at
> org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:53)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:73)
>     at
> org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:92)
>     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:135)
>     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:87)
>     at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:48)
>     at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     at
> org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:48)
>     at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     at
> org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:44)
>     at
> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>     at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>     at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>     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.content(HttpConnection.java:842)
>     at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
>     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)
>
> --
> Víctor González
> http://geomati.co
>



-- 
Víctor González
http://geomati.co
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to