Tomcat应用程序中的Random ConcurrentModificationException

时间:2015-12-18 17:29:29

标签: java apache tomcat siteminder

我们在Tomcat 7.0.54中部署了一个Java应用程序。在tomcat前面有一个带有SiteMinder模块的Apache 2.4.10作为反向代理。 Tomcat在Sun jdk 1.8.0-45-64bit下运行。

当对应用程序的随机资源(图标或js脚本或css)的请求失败时,存在浮动错误

java.util.ConcurrentModificationException
    java.util.PriorityQueue$Itr.next(PriorityQueue.java:535)
    java.lang.Iterable.forEach(Iterable.java:74)
    com.our.groupid.entity.auth.User.getAllPermissionsAsListOfStrings(User.java:129)
    com.our.groupid.app.auth.SiteMinderSessionUserDetails.<init>(SiteMinderSessionUserDetails.java:17)
    com.our.groupid.app.auth.SiteMinderAuthenticationDetailsSource.buildDetails(SiteMinderAuthenticationDetailsSource.java:61)
    com.our.groupid.app.auth.SiteMinderAuthenticationDetailsSource.buildDetails(SiteMinderAuthenticationDetailsSource.java:13)
    org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doAuthenticate(AbstractPreAuthenticatedProcessingFilter.java:178)
    org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:113)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
    org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262)

更糟糕的是,它无法在独立的Tomcat中重现。我想Apache和Tomcat之间的会话\请求有问题,但在日志中找不到任何可疑的东西。

有没有人知道这种行为的根本原因?

1 个答案:

答案 0 :(得分:0)

看起来我找到了它。
Apache使用mod_proxy_http进行操作,并且对标题进行了一些操作。
切换到mod_proxy_ajp解决了我的问题。所以ConcurrentModificationException只是症状。