What does this warning message in the server.log mean: Unable to set request character encoding to UTF-8 from context /<your_webapp>, because request parameters have already been read, or ServletRequest.getReader() has already been called? This warning message means that the web container is complaining about the fact that the web application deployed at /your_webapp is trying to set the request encoding too late in the request's lifecycle, when it is impossible for the container to honor it. See the javadocs of javax.servlet.ServletRequest.setCharacterEncoding():
This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.
The container issues a warning to let you know that a call to ServletRequest.setCharacterEncoding() by your_webapp has no effect and is being ignored, because one of the above conditions is met. To avoid this warning, your_webapp should move its invocation of ServletRequest.setCharacterEncoding() to an earlier stage, before it acquires any input reader from the request, or before it reads any request parameters. In case your_webapp is not responsible for this warning, one if its dependencies might be, in which case that library needs to be fixed. Ignoring this warning If your logfile is filling up with this warning and you'd like to ignore it, just add the following to the logging.properties for your domain (probably GLASSFISH_HOME/glassfish/domains/domain1/config/logging.properties): org.apache.catalina.connector.Request.level=SEVERE
|