weixin_39675038
weixin_39675038
2020-12-02 05:21

Fix handling of NPE in AdvancedDispatchFilter, seen when geoserver-monit...

NullPointerExcepiton is thrown when geoserver-monitor-plugin is added to geoserver 2.5.1 and additional application-specific plugin servlets are added into geoserver.


Stack Trace:
03-Jun-2014 21:02:35.198 SEVERE [ajp-apr-127.0.0.1-8009-exec-10] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [ld-source] in context with path [/geoserver] threw exception
 java.lang.NullPointerException
        at org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest.getPathInfo(AdvancedDispatchFilter.java:89)
        at org.geoserver.monitor.MonitorRequestFilter.filter(MonitorRequestFilter.java:68)
        at org.geoserver.monitor.MonitorFilter.doFilter(MonitorFilter.java:83)
        at org.geoserver.filters.SpringDelegatingFilter$Chain.doFilter(SpringDelegatingFilter.java:70)
        at org.geoserver.filters.SpringDelegatingFilter.doFilter(SpringDelegatingFilter.java:45)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.geoserver.platform.AdvancedDispatchFilter.doFilter(AdvancedDispatchFilter.java:49)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
        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:72)
        at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
        at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.geoserver.security.filter.GeoServerAnonymousAuthenticationFilter.doFilter(GeoServerAnonymousAuthenticationFilter.java:53)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
        at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
        at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
        at org.geoserver.security.filter.GeoServerBasicAuthenticationFilter.doFilter(GeoServerBasicAuthenticationFilter.java:82)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:68)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
        at org.geoserver.security.filter.GeoServerSecurityContextPersistenceFilter$1.doFilter(GeoServerSecurityContextPersistenceFilter.java:52)
        at org.geoserver.security.filter.GeoServerCompositeFilter$NestedFilterChain.doFilter(GeoServerCompositeFilter.java:72)
        at org.geoserver.security.filter.GeoServerCompositeFilter.doFilter(GeoServerCompositeFilter.java:91)
        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:134)
        at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
        at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.geoserver.filters.LoggingFilter.doFilter(LoggingFilter.java:75)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.geoserver.filters.GZIPFilter.doFilter(GZIPFilter.java:42)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.geoserver.filters.SessionDebugFilter.doFilter(SessionDebugFilter.java:47)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.geoserver.filters.FlushSafeFilter.doFilter(FlushSafeFilter.java:43)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at com.vaisala.gis.metrics.filter.AbstractMetricsFilter.doFilter(AbstractMetricsFilter.java:121)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.vfny.geoserver.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:109)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.ajp.AjpAprProcessor.process(AjpAprProcessor.java:190)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
        at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2378)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:744)

该提问来源于开源项目:geoserver/geoserver

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39760967 weixin_39760967 5月前

    The patch looks good, in order to apply and backport to the 2.5.x series we also need a jira ticket to refer to (for the release notes), could you open one? jira.codehaus.org/browse/GEOS

    点赞 评论 复制链接分享
  • weixin_39675038 weixin_39675038 5月前

    Jira issue created as:

    http://jira.codehaus.org/browse/GEOS-6529

    点赞 评论 复制链接分享
  • weixin_39719476 weixin_39719476 5月前

    Patch looks ok to me, although there are a lot of pure whitespace changes which we typically ask to be cleaned up.

    点赞 评论 复制链接分享
  • weixin_39675038 weixin_39675038 5月前

    Ah ok, do you want me to clean that and resubmit?

    On Tuesday, June 10, 2014, Justin Deoliveira notifications.com wrote:

    Patch looks ok to me, although there are a lot of pure whitespace changes which we typically ask to be cleaned up.

    — Reply to this email directly or view it on GitHub https://github.com/geoserver/geoserver/pull/606#issuecomment-45614124.

    点赞 评论 复制链接分享
  • weixin_39719476 weixin_39719476 5月前

    If it is not too much trouble yes please. Thanks for understanding :)

    点赞 评论 复制链接分享
  • weixin_39684495 weixin_39684495 5月前

    Any chance of getting this one for RC next week ?

    点赞 评论 复制链接分享
  • weixin_39675038 weixin_39675038 5月前

    OK, merged with master and reverted unnecessary whitespace changes. Diffs on pull request screen now show as minimal set for fix. I can't figure out how to squash my 5 commits down to 1 -- please let me know if that's necessary to get this pull merged.

    -=- D. J.

    点赞 评论 复制链接分享
  • weixin_39719476 weixin_39719476 5月前

    Looks good to me, thanks a lot for cleaning it up.

    On Thu, Aug 7, 2014 at 10:36 PM, D. J. Hagberg notifications.com wrote:

    OK, merged with master and reverted unnecessary whitespace changes. Diffs on pull request screen now show as minimal set for fix. I can't figure out how to squash my 5 commits down to 1 -- please let me know if that's necessary to get this pull merged.

    -=- D. J.

    — Reply to this email directly or view it on GitHub https://github.com/geoserver/geoserver/pull/606#issuecomment-51562611.

    Justin Deoliveira VP Engineering | Boundless http://boundlessgeo.com/ jdeolive.com http://twitter.com/boundlessgeo/

    点赞 评论 复制链接分享
  • weixin_39684495 weixin_39684495 5月前

    Had to cherry pick these over to master (and then squash) as you had used "merge" rather than "rebase". Thanks for the fix.

    点赞 评论 复制链接分享

相关推荐