2016-11-08 29 views
0

我正在升級舊項目的框架。這些更新包括幾個主要版本:ConcurrentModificationException在更新到Hibernate 5.2.4之後,Spring 4.3.3,Struts 2.5.5

  1. 休眠3.1 - > 5.2.4
  2. 春2.1 - > 4.3.3
  3. 的Struts 2.1 - > 2.5.5
  4. 彈簧安全2.X - > 4.1.3
  5. 阿帕奇百科全書集合3.2.1 - > 3.2.2(如果需要更新到4.x的是可能的)

JDK沒有遭受任何更新,我們使用的是Java 8.雖然我相信沒有源頭e代碼在更新之前使用任何Java 8功能。

我扶着編譯器和我固定所有的類引用,更新DTD的框架等

最後的項目只有幾個棄用wornings並沒有錯誤編譯。然而,只要我加載索引頁面,登錄提示,我會得到下面的錯誤。

下面的代碼中只有4個類不屬於Spring/Strut/Hibernate,但他們所做的只是在Spring安全性上調用doFilter。簡單的授權。我不創建,返回或遍歷任何列表或hashmaps。

任何想法表示讚賞。下面全堆棧跟蹤。謝謝。

SEVERE: Servlet.service() for servlet [default] in context with path [/FeedXLWebapp] threw exception 
java.util.ConcurrentModificationException 
    at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437) 
    at java.util.HashMap$KeyIterator.next(HashMap.java:1461) 
    at org.apache.commons.collections.iterators.IteratorEnumeration.nextElement(IteratorEnumeration.java:76) 
    at java.util.ResourceBundle.handleKeySet(ResourceBundle.java:1854) 
    at java.util.ResourceBundle.containsKey(ResourceBundle.java:1807) 
    at org.springframework.context.support.ResourceBundleMessageSource.getStringOrNull(ResourceBundleMessageSource.java:291) 
    at org.springframework.context.support.ResourceBundleMessageSource.resolveCodeWithoutArguments(ResourceBundleMessageSource.java:131) 
    at org.springframework.context.support.AbstractMessageSource.getMessageInternal(AbstractMessageSource.java:218) 
    at org.springframework.context.support.AbstractMessageSource.getMessage(AbstractMessageSource.java:136) 
    at org.springframework.context.support.AbstractApplicationContext.getMessage(AbstractApplicationContext.java:1249) 
    at org.springframework.context.support.MessageSourceAccessor.getMessage(MessageSourceAccessor.java:83) 
    at org.springframework.security.access.vote.AffirmativeBased.decide(AffirmativeBased.java:84) 
    at org.springframework.security.access.intercept.AbstractSecurityInterceptor.beforeInvocation(AbstractSecurityInterceptor.java:233) 
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:124) 
    at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:115) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at au.com.xprime.feedxl.accounts.security.spring.AuthenticationPostProcessingFilter.doFilterHttp(AuthenticationPostProcessingFilter.java:33) 
    at au.com.xprime.feedxl.accounts.security.spring.AuthenticationPostProcessingFilter.doFilter(AuthenticationPostProcessingFilter.java:22) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:150) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:121) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) 
    at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) 
    at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) 
    at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) 
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) 
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at au.com.xprime.feedxl.accounts.auth.filters.BrowserCheckFilter.doFilter(BrowserCheckFilter.java:32) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at au.com.xprime.webapp.filters.ResponseCacheControlFilter.doFilter(ResponseCacheControlFilter.java:102) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176) 
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145) 
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92) 
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:389) 
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) 
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) 
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) 
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) 
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) 
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) 
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) 
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) 
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) 
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) 
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) 
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 
+0

確認您是否升級了JDK和/或Apache Commons Collections。如果是,那麼到哪個版本? –

+0

@ Bond-JavaBond我使用您要求的jdk和庫版本更新了我的文章。我也試着用commons-collections 4.1做一個快速運行,但是它好像在3.2.2和4.1之間有很大的改變。我會和普通人一起玩4.1,因爲缺乏更好的想法,也許它會起作用。 –

+0

Okies ..因爲您已經使用JDK 8,它似乎是不同的問題,因爲JDK 8有某些增強,導致'ConcurrentModificationException' –

回答

0

所以,我認爲這是我們的。這個問題是一個鏈式消息fetcher類。

當你有一個對象的集合(比如一個HashMap)並且這個集合中的一個對象試圖將新的元素附加到同一個集合時,好像併發修改異常被拋出。

相關問題