6/5/11

WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called

While using Glassfish v3.1 with JSF 2.0 I ended up getting this very annoying warning.
WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context /, because request parameters have already been read, or ServletRequest.getReader() has already been called


This seems to be very common with a very hard to find solution on google.
Finnally after a lot of search I found this link which had the solution.

http://mpashworth.wordpress.com/2011/06/01/glassfish-3-1-pwc4011-warning-with-jsf-applications/

I hope by placing the link here it will come up in google's answers


Place the following in the glassfish-web.xml of the web application.
<parameter-encoding default-charset="UTF-8"/>


<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
 <parameter-encoding default-charset="UTF-8"/>
...
</glassfish-web-app>

1 comment:

  1. Anonymous12/6/11 21:22

    You are a god saver. I am bugged with this warning for several months.
    Thank you

    ReplyDelete