You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Rao G.Srinivasa" <Ra...@JohnDeere.com> on 2011/03/17 08:53:17 UTC

Caused by: java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap

Hi,

I have developed a web application. It's working fine with the Web Sphere. I have deployed the same application into the tomcat 6.0.14, the deployment was successful.
But I try to use some functionalities such as saving data after entering input to the page, it's throwing the following error message and the operation was failed.

Caused by: java.lang.IllegalStateException<http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html>: No modifications are allowed to a locked ParameterMap
at org.apache.catalina.util.ParameterMap.put(ParameterMap.java:166)
at com.deere.u90.iaf.ejpm.utility.HttpServletRequestMapper.mapToBean(HttpServletRequestMapper.java:42)
... 25 more
Requesting you please let me know that what may be the mistake and provided solution.



Thanks,
Srinivas.

Thanks,
G Srinivasa Rao

Re: Caused by: java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap

Posted by Mark Thomas <ma...@apache.org>.
On 17/03/2011 08:55, André Warnier wrote:
> From the fairly explicit
> error messages below, it looks like you are trying to *modify* the
> received form parameters Map, which under Tomcat's interpretation of
> HTTP request handling is a no-no. (The Servlet Spec 3.0 does not
> explicitly say so (Chapter 3), but strongly hints in that direction
> (there are only "get" methods, no "set" ones).

Actually this is defined in the Servlet spec, but only in the Javadoc.
Including key information only in the Javadoc is something that
regularly drives me nuts with the Servlet spec.

The relevant info is in the Javadoc for
ServletRequest#getParameterMap(). It states quite clearly that the
parameter map is immutable.

If this worked in WebSphere then WebSphere is not following the
specification. Either because of a bug or because it has been
explicitly configured to ignore that part of the spec.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Caused by: java.lang.IllegalStateException: No modifications are allowed to a locked ParameterMap

Posted by André Warnier <aw...@ice-sa.com>.
Rao G.Srinivasa wrote:
> Hi,
> 
> I have developed a web application. It's working fine with the Web Sphere. I have deployed the same application into the tomcat 6.0.14, the deployment was successful.
> But I try to use some functionalities such as saving data after entering input to the page, 

That is a very imprecise description, which says not much at all.
But I'll try to use Pid's crystal ball.

Entering data into a page is typically done in a browser, on a workstation. By "saving 
data", I guess you mean doing something on the server, after the client submitted a 
<form>.  From the fairly explicit error messages below, it looks like you are trying to 
*modify* the received form parameters Map, which under Tomcat's interpretation of HTTP 
request handling is a no-no. (The Servlet Spec 3.0 does not explicitly say so (Chapter 3), 
but strongly hints in that direction (there are only "get" methods, no "set" ones).

I would say that in the interest of portability between containers, you should store these 
values somewhere else, and not try to "stuff them back" in the ParameterMap.
You should probably consider the whole Request as read-only.

it's throwing the following error message and the operation was failed.
> 
> Caused by: java.lang.IllegalStateException<http://download.oracle.com/javase/6/docs/api/java/lang/IllegalStateException.html>: No modifications are allowed to a locked ParameterMap
> at org.apache.catalina.util.ParameterMap.put(ParameterMap.java:166)
> at com.deere.u90.iaf.ejpm.utility.HttpServletRequestMapper.mapToBean(HttpServletRequestMapper.java:42)
> ... 25 more
> Requesting you please let me know that what may be the mistake and provided solution.
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org