Target Unreachable, identifier 'KeyboardBean' resolved to null

Boa noite pessoal,

Estou estudando o primefaces. Junto com ele estou desenvolvendo uma tela de login, só que quando clico no botão [Home] para redirecionar a página, me dá o seguinte erro:

É um bean simples para testar o <p:Keyboard /> que peguei no site www.primefaces.org, vejam:

package br.com.teste;

public class KeyboardBean {
    private String value1;

    public String getValue1() {
        return value1;
    }

    public void setValue1(String value1) {
        this.value1 = value1;
    }
    
}

Este é minha tela de login:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <h:head>
        <title>Login</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link type="text/css" rel="stylesheet" href="resources/css/primefaces/skin/aristo/theme.css" />
        <link type="text/css" rel="stylesheet" href="resources/css/primefaces/syntaxhighlighter.css" />
    </h:head>

    <h:body>
        <center>
            <div style="padding-top: 8%">
                <p:fieldset  legend="Login" toggleable="true" >
                    <h:form style="text-align: left;" >
                        <p:focus for="username" />
                        <h:panelGrid columns="2" id="display" cellpadding="2">
                            <h:outputText value="Username:"/>
                            <p:inputText id="username" required="true" label="username" value="#{KeyboardBean.value1}"/>
                            <h:outputText value="Password:" />  
                            <p:keyboard required="true" password="true" value="#{KeyboardBean.value1}"  />  
                            <f:facet name="footer" id="fctFooter">  
                               <h:commandButton action="index.xhtml" value="Retornar" /> 
                            </f:facet> 
                        </h:panelGrid>
                        <p:messages id="mensagens" showDetail="true" />
                    </h:form>                  
                </p:fieldset>
            </div>                
        </center>
    </h:body> 
</html>

Se possível, gostaria que alguém me ajudasse.

Abraços

vc tem q anotar o ManagedBean…

Bom dia Luxu,

Fiz como você orientou, mas o erro persiste. Tem mais alguma sugestão??
package br.com.teste;  
  
@ManagedBean
public class KeyboardBean {  
    private String value1;  
  
    public String getValue1() {  
        return value1;  
    }  
  
    public void setValue1(String value1) {  
        this.value1 = value1;  
    }  
      
} 

tente colocar algum escopo, o melhor é o view, mas tem q ver sua necessidade…

Pois é, eu já coloquei @ViewScoped , mas também não deu certo.

Acredito que seja uma coisa tão simples, mas não consigo resolver.

Estou trabalhando com Hibernate 3 + Primefaces 2.2.1 + Netbeans 7.01.

Estou tendo o mesmo problema que você amigo.

[code]javax.servlet.ServletException: /pages/usuario/cadastroCliente.xhtml @18,86 value="#{cadastroClienteMB.cliente.nome}": Target Unreachable, identifier ‘cadastroClienteMB’ resolved to null
root cause

javax.el.PropertyNotFoundException: /pages/usuario/cadastroCliente.xhtml @18,86 value="#{cadastroClienteMB.cliente.nome}": Target Unreachable, identifier ‘cadastroClienteMB’ resolved to null[/code]

JSF 2, Prime 3 e EJB.

To passando pelo menos perrengue qdo tento com Eclipse (JBoss 7), no NetBeans (Glassfish) a coisa funfa direitinho.
Ainda tentando entender…

Tentem definir um nome para o managedBean assim

@ManagedBean(name = "meuManagedBean")

e usem esse nome pra acessar seus atributos

#{meuManagedBean.atributo}