2016-12-28 53 views
0

生病了這惱人的錯誤:Tomcat的:沒有修改被允許鎖定parameterMap的

java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap 
at org.apache.catalina.util.ParameterMap.put(ParameterMap.java:164) 
at org.springframework.data.rest.webmvc.RestRepositoryEntityController.getParametersForPostAction(RestRepositoryEntityController.java:182) 
at org.springframework.data.rest.webmvc.RestRepositoryEntityController.performPostAction(RestRepositoryEntityController.java:158) 
at org.springframework.data.rest.webmvc.RestRepositoryEntityController.performOneArgumentPostRepositoryAction(RestRepositoryEntityController.java:90) 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:606) 
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) 
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) 
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) 
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) 
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) 
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) 
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:966) 
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) 
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) 
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) 
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) 
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) 
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) 
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:747) 
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:485) 
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:410) 
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:337) 

試圖訪問某個資源的休息後我得到這個。 一切工作正常生產,所以我想我的本地電腦上有一些tomcat問題。 花費兩個小時試圖找到答案,但沒有成功。

有沒有人發生過同樣的錯誤? 需要幫助!

+0

對我來說,您似乎試圖回收/重新使用某些ParameterMap,並且您無法這樣做(如錯誤消息所述)。嘗試創建一個新的ParameterMap – 2016-12-28 16:56:57

回答

1

這可能是因爲你正在分配request.getParameterMap()的任何變量。取而代之的是嘗試使用

Map<String, String[]> map = new HashMap<>(request.getParameterMap()); 

which will only create a copy of it. 

有時這可能會解決你的問題

0

沒有找到任何理由這樣的行爲。 唯一有所幫助 - 我將tomcat版本從7.0.68更改爲7.0.61

相關問題