PWC4011: Unable to set request character encoding to UTF-8 from context [resolvido]

8 respostas
juniorsatanas

Pessoal bom dia !

Estou pegando um erro no console, que não sei como resolver e o do que se trata. ex:

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

meu web.xml

<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- configura o controlador do VRaptor --> <filter> <filter-name>vraptor</filter-name> <filter-class>br.com.caelum.vraptor.VRaptor</filter-class> </filter> <context-param> <param-name>br.com.caelum.vraptor.encoding</param-name> <param-value>UTF-8</param-value> </context-param> <filter-mapping> <filter-name>vraptor</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> <dispatcher>REQUEST</dispatcher> </filter-mapping> </web-app>

8 Respostas

Lucas_Cavalcanti

isso acontece sempre? toda requisição?

juniorsatanas

Sim!

Lucas_Cavalcanti

qual servidor vc tah usando?

juniorsatanas

GlasFishe !

Lucas_Cavalcanti

versão?

juniorsatanas

Sun GlassFish Enterprise Server v3 Application Development Guide
netbeans 6.9
Linux Ubuntu

Lucas_Cavalcanti

o glassfish 3 já suporta Servlet 3, então vc não deveria declarar o filtro do VRaptor no seu web.xml…

seu web.xml deve ficar assim:

<?xml version="1.0" encoding="UTF-8"?>  
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">  
<context-param>  
    <param-name>br.com.caelum.vraptor.encoding</param-name>  
    <param-value>UTF-8</param-value>  
</context-param>  
</web-app>
Mr.style

http://wikis.sun.com/display/glassfish/FaqWebAppUnableToSetRequestCharEncoding

Criado 10 de dezembro de 2010
Ultima resposta 31 de mai. de 2011
Respostas 8
Participantes 3