Erro com glassfish 3.1

Bom Dia pessoal, intalei o netbeans 7.0 e o glassfish 3.1, agora executo minha aplicação e aparece esses erros:

na pagina:

The button/link/text component needs to have a Form in its ancestry. Please add .The button/link/text component needs to have a Form in its ancestry. Please add .

no netbeans:

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

Xhtml:

<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Gerar Pedido de Compra</title>
        <link type="text/css" rel="stylesheet" href="css/skin.css"/>
    </h:head>
    <h:body>

        <p:layout fullPage="true">

            <p:layoutUnit position="top" height="90" resizable="true" style="position: relative; text-align: center">
                <h:form>
                    <h:outputText value="Pedido de compra" style="font-family: Tahoma; font-size: 30px; font-style: bold" />
                    <h:panelGrid columns="2" style="margin-left: 45%;text-align: center">
                        <h:outputText value="NUMERO" style="font-family: Tahoma; font-size: 15px; font-style: bold" />
                        <h:outputText value="DATA" style="font-family: Tahoma; font-size: 15px; font-style: bold" />
                        <h:outputText value="01/#{genSerialView.ano}" style="font-family: Tahoma; font-size: 12px; font-style: bold" />
                        <h:outputText value="#{genSerialView.data}" style="font-family: Tahoma; font-size: 12px; font-style: bold" />
                    </h:panelGrid>
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="left" width="100" header="" resizable="true" collapsible="true" maxWidth="100" style="text-align: center">
                <h:form>
                    <p:menu>
                        <p:submenu label="Menu ->">
                            <p:menuitem value="Menu01" url="http://localhost:8080/SISC" ajax="false"/>
                            <p:menuitem value="Menu02" url="#"/>
                            <p:menuitem value="Menu03" url="#"/>
                        </p:submenu>
                    </p:menu>
                    <br/>
                    &lt;h:graphicImage value="img/logo.PNG"/&gt;
                &lt;/h:form&gt;
            &lt;/p:layoutUnit&gt;

            &lt;p:layoutUnit position="right" width="200" header="" resizable="true" collapsible="true"&gt;
                &lt;p:calendar mode="inline"/&gt;
            &lt;/p:layoutUnit&gt;

            &lt;p:layoutUnit position="center" scrollable="true"&gt;
                &lt;p:ajaxStatus style="width:16px;height:16px;"&gt;
                    &lt;f:facet name="start"&gt;
                        &lt;h:graphicImage value="img/ajaxloading.gif" /&gt;
                    &lt;/f:facet&gt;

                    &lt;f:facet name="complete"&gt;
                        &lt;h:outputText value="" /&gt;
                    &lt;/f:facet&gt;
                &lt;/p:ajaxStatus&gt;
                &lt;div align=""&gt;
                    &lt;h:form id="idid"&gt;
                        &lt;p:panel id="teste" header="Autorização / Fornecedor" toggleable="true" toggleSpeed="200"&gt;
                            &lt;h:panelGrid columns="2"&gt;
                                &lt;h:outputText value="Referente Autorização Nº:" style="font-family: Tahoma; font-size: 11px; font-style: bold" /&gt;
                                &lt;h:selectOneMenu value="#{itensBean.itens}"&gt;&lt;f:selectItems value="#{itensBean.itens}"/&gt;&lt;/h:selectOneMenu&gt;
                                &lt;h:outputText value="Fornecedor:" style="font-family: Tahoma; font-size: 11px; font-style: bold" /&gt;
                                &lt;h:selectOneMenu value="#{itensBean.itens}"&gt;&lt;f:selectItems value="#{itensBean.itens}"/&gt;&lt;/h:selectOneMenu&gt;
                            &lt;/h:panelGrid&gt;
                        &lt;/p:panel&gt;
                        &lt;p:panel header="Forma de pagamento" id="forma_pagamento" toggleable="true" toggleSpeed="200"&gt;
                            &lt;h:panelGrid columns="2"&gt;
                                &lt;h:outputText value="A Vista" style="font-family: Tahoma; font-size: 11px; font-style: bold"/&gt;&lt;h:selectBooleanCheckbox value="#{formaPagamento.avista}"&gt;&lt;p:ajax event="change" update="forma_pagamento"/&gt;&lt;/h:selectBooleanCheckbox&gt;
                                &lt;h:outputText value="Parcelado" style="font-family: Tahoma; font-size: 11px; font-style: bold"/&gt;&lt;h:selectBooleanCheckbox value="#{formaPagamento.parcelado}"&gt;&lt;p:ajax event="change" update="forma_pagamento"/&gt;&lt;/h:selectBooleanCheckbox&gt;
                            &lt;/h:panelGrid&gt;
                            &lt;h:panelGrid columns="2"&gt;
                                &lt;h:outputText value="Quantidade de parcelas :" style="font-family: Tahoma; font-size: 11px; font-style: bold" rendered="#{formaPagamento.parcelado}"/&gt;
                                &lt;h:inputText id="parc" value="#{formaPagamento.parcelas}" rendered="#{formaPagamento.parcelado}"&gt;
                                    &lt;f:convertNumber for="parc" maxIntegerDigits="1" type="number"/&gt;
                                &lt;/h:inputText&gt;
                                &lt;h:outputText value="Previsão de inicio do pagamento :" style="font-family: Tahoma; font-size: 11px; font-style: bold" rendered="#{formaPagamento.parcelado}"/&gt;
                                &lt;p:calendar value="#{formaPagamento.dataPagamento}" effect="fade" effectDuration="50" rendered="#{formaPagamento.parcelado}"/&gt;
                                &lt;h:outputText value="Data de pagamento :" style="font-family: Tahoma; font-size: 11px; font-style: bold" rendered="#{formaPagamento.avista}"/&gt;
                                &lt;p:calendar value="#{formaPagamento.dataPagamento}" effect="fade" effectDuration="50" rendered="#{formaPagamento.avista}"/&gt;
                            &lt;/h:panelGrid&gt;
                        &lt;/p:panel&gt;
                    &lt;/h:form&gt;
                    &lt;h:form id="cad"&gt;
                        &lt;p:panel header="Cadastrar novo item" toggleable="true" toggleSpeed="200"&gt;
                            &lt;h:panelGrid id="grid" columns="4" &gt;

                                &lt;h:outputLabel value="Quantidade : " for="txt_qtd"&gt;&lt;p:focus for="txt_qtd" /&gt;&lt;/h:outputLabel&gt;
                                &lt;h:inputText id="txt_qtd" value="#{itensBean.item.quantidade}" required="true" requiredMessage="Informe a quantidade do Item !" converterMessage="Use somente NUMEROS na quantidade !"&gt;&lt;f:convertNumber for="javax.faces.Double"/&gt;&lt;/h:inputText&gt;

                                &lt;h:outputLabel value="Unidade : " for="txt_und" &gt;&lt;/h:outputLabel&gt;
                                &lt;h:inputText id="txt_und" style="text-transform:uppercase" value="#{itensBean.item.und}" required="true" requiredMessage="Informe o tipo de Unidade !" /&gt;

                                &lt;h:outputLabel value="Valor Unitário : " for="txt_valorUn"&gt;&lt;/h:outputLabel&gt;
                                &lt;h:inputText id="txt_valorUn" value="#{itensBean.item.valorUn}" required="true" requiredMessage="Informe o valor unitário !" converterMessage="Use somente NUMEROS no valor unitário !"&gt;&lt;f:convertNumber for="javax.faces.Double"/&gt;&lt;/h:inputText&gt;

                                &lt;h:outputLabel value="Descrição : " for="txt_desc"&gt;&lt;/h:outputLabel&gt;
                                &lt;h:inputTextarea id="txt_desc" cols="1" style=" width: 100%; height: 30px;text-transform:uppercase" value="#{itensBean.item.descricao}" required="true" requiredMessage="Informe a descrição do Item !" &gt;
                                    &lt;p:resizable maxWidth="500" maxHeight="40" minHeight="40" minWidth="100" /&gt;
                                &lt;/h:inputTextarea&gt;

                                &lt;p:commandButton update="item:itens,val_total,grid,idid:teste" image="ui-icon ui-icon-disk" value="Cadastrar " action="#{itensBean.save}" &gt;
                                    &lt;p:collector value="#{itensBean.item}" addTo="#{itensBean.itens}" /&gt;
                                &lt;/p:commandButton&gt;
                                &lt;h:column/&gt;
                                &lt;h:column/&gt;
                                &lt;h:column&gt;
                                    &lt;p:message for="txt_qtd"/&gt;
                                    &lt;p:message for="txt_und"/&gt;
                                    &lt;p:message for="txt_valorUn"/&gt;
                                    &lt;p:message for="txt_desc"/&gt;
                                &lt;/h:column&gt;
                            &lt;/h:panelGrid&gt;
                            &lt;p:messages showDetail="true" /&gt;
                        &lt;/p:panel&gt;
                    &lt;/h:form&gt;
                    &lt;h:form id="item"&gt;
                        &lt;p:panel toggleable="true" toggleSpeed="200" id="itens" header="Itens Cadastrados"&gt;
                            &lt;p:dataTable value="#{itensBean.itens}" var="item"  emptyMessage="Nenhum item inserido" style="text-align: center"&gt;
                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Quantidade" /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;p:cellEditor&gt;
                                        &lt;f:facet name="output"&gt;
                                            &lt;h:outputText value="#{item.quantidade}"/&gt;
                                        &lt;/f:facet&gt;
                                        &lt;f:facet name="input"&gt;
                                            &lt;h:inputText value="#{item.quantidade}"&gt; &lt;f:convertNumber for="javax.faces.Double"/&gt;&lt;/h:inputText&gt;
                                        &lt;/f:facet&gt;
                                    &lt;/p:cellEditor&gt;

                                &lt;/p:column&gt;

                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Unidade" /&gt;
                                    &lt;/f:facet&gt;

                                    &lt;p:cellEditor&gt;
                                        &lt;f:facet name="output"&gt;
                                            &lt;h:outputText value="#{item.und}"/&gt;
                                        &lt;/f:facet&gt;
                                        &lt;f:facet name="input"&gt;
                                            &lt;h:inputText value="#{item.und}"/&gt;
                                        &lt;/f:facet&gt;
                                    &lt;/p:cellEditor&gt;
                                &lt;/p:column&gt;

                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Descrição do Produto" /&gt;
                                    &lt;/f:facet&gt;

                                    &lt;p:cellEditor&gt;
                                        &lt;f:facet name="output"&gt;
                                            &lt;h:outputText value="#{item.descricao}" /&gt;
                                        &lt;/f:facet&gt;
                                        &lt;f:facet name="input"&gt;
                                            &lt;h:inputText value="#{item.descricao}"/&gt;
                                        &lt;/f:facet&gt;
                                    &lt;/p:cellEditor&gt;
                                &lt;/p:column&gt;

                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Valor Unitátio" /&gt;
                                    &lt;/f:facet&gt;

                                    &lt;p:cellEditor&gt;
                                        &lt;f:facet name="output"&gt;
                                            &lt;h:outputText value="#{item.valorUn}" /&gt;
                                        &lt;/f:facet&gt;
                                        &lt;f:facet name="input"&gt;
                                            &lt;h:inputText value="#{item.valorUn}"&gt; &lt;f:convertNumber type="currency" for="javax.faces.Double"/&gt;&lt;/h:inputText&gt;
                                        &lt;/f:facet&gt;
                                    &lt;/p:cellEditor&gt;
                                &lt;/p:column&gt;

                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Valor Total" /&gt;
                                    &lt;/f:facet&gt;
                                    &lt;h:outputText value="#{item.valorTotal}" /&gt;
                                &lt;/p:column&gt;

                                &lt;p:column&gt;
                                    &lt;f:facet name="header"&gt;
                                        &lt;h:outputText value="Excluir" /&gt;
                                    &lt;/f:facet&gt;

                                    &lt;p:commandButton image="ui-icon ui-icon-trash" value="Excluir " update="item:itens"&gt;
                                        &lt;p:collector value="#{item}" removeFrom="#{itensBean.itens}"  /&gt;
                                    &lt;/p:commandButton&gt;

                                &lt;/p:column&gt;

                                &lt;p:column headerText="Alterar"&gt;
                                    &lt;p:rowEditor /&gt;
                                &lt;/p:column&gt;

                            &lt;/p:dataTable&gt;
                            <br/>
                            &lt;p:graphicText value=" TOTAL GERAL DO PEDIDO R$ #{itensBean.total}" fontName="Tahoma" fontSize="10" style="margin-right: 80%"/&gt;
                        &lt;/p:panel&gt;
                    &lt;/h:form&gt;
                &lt;/div&gt;
            &lt;/p:layoutUnit&gt;
        &lt;/p:layout&gt;
    &lt;/h:body&gt;
&lt;/html&gt;

P/s: No glassfish anterior estava ok !

Conseguiu resolver o problema ? Notei o mesmo no meu quando uso TabView.

Tem como contornar se está configurado no web.xml

<context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param>

E trocar o param-value por

<param-value>Production</param-value>

No GlassFish 3.0 era so colocar a versão 2.04 do mojarra, JS2.0
Mas no 3.1 nem assim ta funfando, troquei na aplicação, no proprio glassfish, pasta C:\Sun\glassfish3\glassfish\modules
Mesmo assim o problema continua…

Somente com a dica do amigo assima, edudebom, o problema acabou…

Ta um saco esse bug, num sei se é do JSF ou PrimeFaces, só da quando tem algum menuitem…

Trocando para Production só não exige o aviso, mas o “problema” permanece. Mas também não é um erro pois é só um alerta de warning.

Quando tenho um dataTable do primefaces e clico num botão editar que seta um objeto no meu Bean eu recebo uma nullPointerException na tela e unica coisa que aparece no console do glassfish é isso:

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

Alguém tem alguma idéia do que possa ser?

Já fiz o teste sem usar o primefaces e funciona certinho, mais com o prime da pau.

[quote]Quando tenho um dataTable do primefaces e clico num botão editar que seta um objeto no meu Bean eu recebo uma nullPointerException na tela e unica coisa que aparece no console do glassfish é isso:

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

Alguém tem alguma idéia do que possa ser?

Já fiz o teste sem usar o primefaces e funciona certinho, mais com o prime da pau. [/quote]

Cara melhor postar o código, mas abra outra thread, porque o assunto não é o mesmo…

Então amigo, andei lendo na web e acabei usando o primefaces 2.2.1 agora funciona perfeito.

Vlw. Obrigado.

Respondido neste tópico: http://www.guj.com.br/java/220501-pwc4011-unable-to-set-request-character-encoding-to-utf-8

[quote=edudebom]Conseguiu resolver o problema ? Notei o mesmo no meu quando uso TabView.

Tem como contornar se está configurado no web.xml

<context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param-value> </context-param>

E trocar o param-value por

<param-value>Production</param-value>

Cara! Você acaba de salvar meu TCC! kkkkkkk
Obrigada!! :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: :lol: