Tomcat 7.0.2上的java.lang.IllegalStateException,但在WAS7上运行正常

时间:2013-03-05 14:13:37

标签: java jsf-2 tomcat7 websphere-7 illegalstateexception

我在Websphere Application Server 7.0上有这个应用程序,我正在移植到tomcat 7.0.2

我的应用程序中有以下代码行:

parameters.remove("MainUserId");
parameters.remove("MainPassword");

此代码在Tomcat上给出了以下异常

java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap
    at org.apache.catalina.util.ParameterMap.remove(ParameterMap.java:211)
    at com.csc.fs.accel.ui.action.admin.user.UserAccess.updateUser(UserAccess.java:1386)
    at com.csc.fs.accel.ui.action.admin.user.UserAccess.doPost(UserAccess.java:1775)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

这里parameters基本上是一个会话参数图。因此根据java规范参数map是不可变的。但这对Websphere Application服务器很有用。

在研究时,我读了一条评论here,上面写着

  

如果这在WebSphere中有效,那么WebSphere就不会遵循   规格。无论是因为一个错误还是因为它已经存在   明确配置为忽略规范的那一部分。

任何替代方案?除了不删除地图中的元素

此外,如果tomcat中有任何配置可以使参数映射mutable吗?

0 个答案:

没有答案