Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3945570
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:01:54+00:00 2026-05-20T01:01:54+00:00

Can anyone help us with this? We’re trying to make the register user feature

  • 0

Can anyone help us with this?

We’re trying to make the register user feature in our JSF application. We want the user log in right after he registers. After the user hits the I’m a new client commandLink, we have this exception, and we don’t know how to handle it:

com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed bean registerBean
    at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:394)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:260)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86)
    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
    at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
    at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:99)
    at com.sun.el.parser.AstValue.getValue(AstValue.java:158)
    at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
    at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102)
    at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
    at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
    at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
    at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:205)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:338)
    at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:164)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
    at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
    at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
    at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
    at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
    at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
    at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
    at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
    at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
    at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
    at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
    at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
    at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
    at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
    at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
    at java.lang.Thread.run(Thread.java:662)
Caused by: com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed property loginBean
    at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:117)
    at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:349)
    ... 50 more
Caused by: java.lang.NullPointerException
    at com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:350)
    at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107)
    ... 51 more

Here are the LoginBean and the RegisterBean:

@ManagedBean
@SessionScoped
public class LoginBean
{
    private String      username, password;
    private User        user;
    private UserManager um  = UserManager.getInstance();

    /**
     * 
     */
    public LoginBean()
    {
        super();
    }

    /**
     * @return the username
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * @return the password
     */
    public String getPassword()
    {
        return password;
    }

    public void setUser(User user)
    {
        this.user = user;
        username = user.getUsername();
        password = user.getPassword();
    }

    /**
     * @return the user
     */
    public User getUser()
    {
        return user;
    }

    /**
     * @param username
     *             the username to set
     */
    public void setUsername(String username)
    {
        this.username = username;
    }

    /**
     * @param password
     *             the password to set
     */
    public void setPassword(String password)
    {
        this.password = password;
    }

    public String nextPage()
    {
        try
        {
            user = um.getUser(username, password);
        }
        catch (NoResultException e)
        {
            return "failure" + REDIRECT;
        }

        if (user instanceof Client)
            return "home_client" + REDIRECT;

        return "home_admin" + REDIRECT;

    }
}

@ManagedBean
@RequestScoped
public class RegisterBean
{
    private String      username, password, repassword, firstname, lastname, email, address, city, county, postcode, country, phone;

    @ManagedProperty(value = "#{loginBean}")
    private LoginBean   loginBean;

    // private UserManager um = UserManager.getInstance();

    public RegisterBean()
    {
    }

    /**
     * @return the username
     */
    public String getUsername()
    {
        return username;
    }

    /**
     * @return the password
     */
    public String getPassword()
    {
        return password;
    }

    /**
     * @return the repassword
     */
    public String getRepassword()
    {
        return repassword;
    }

    /**
     * @return the firstname
     */
    public String getFirstname()
    {
        return firstname;
    }

    /**
     * @return the lastname
     */
    public String getLastname()
    {
        return lastname;
    }

    /**
     * @return the email
     */
    public String getEmail()
    {
        return email;
    }

    /**
     * @return the address
     */
    public String getAddress()
    {
        return address;
    }

    /**
     * @return the city
     */
    public String getCity()
    {
        return city;
    }

    /**
     * @return the county
     */
    public String getCounty()
    {
        return county;
    }

    /**
     * @return the postcode
     */
    public String getPostcode()
    {
        return postcode;
    }

    /**
     * @return the country
     */
    public String getCountry()
    {
        return country;
    }

    /**
     * @return the phone
     */
    public String getPhone()
    {
        return phone;
    }

    /**
     * @return the user
     */
    public LoginBean getLoginBean()
    {
        return loginBean;
    }

    /**
     * @param username
     *             the username to set
     */
    public void setUsername(String username)
    {
        this.username = username;
    }

    /**
     * @param password
     *             the password to set
     */
    public void setPassword(String password)
    {
        this.password = password;
    }

    /**
     * @param repassword
     *             the repassword to set
     */
    public void setRepassword(String repassword)
    {
        this.repassword = repassword;
    }

    /**
     * @param firstname
     *             the firstname to set
     */
    public void setFirstname(String firstname)
    {
        this.firstname = firstname;
    }

    /**
     * @param lastname
     *             the lastname to set
     */
    public void setLastname(String lastname)
    {
        this.lastname = lastname;
    }

    /**
     * @param email
     *             the email to set
     */
    public void setEmail(String email)
    {
        this.email = email;
    }

    /**
     * @param address
     *             the address to set
     */
    public void setAddress(String address)
    {
        this.address = address;
    }

    /**
     * @param city
     *             the city to set
     */
    public void setCity(String city)
    {
        this.city = city;
    }

    /**
     * @param county
     *             the county to set
     */
    public void setCounty(String county)
    {
        this.county = county;
    }

    /**
     * @param postcode
     *             the postcode to set
     */
    public void setPostcode(String postcode)
    {
        this.postcode = postcode;
    }

    /**
     * @param country
     *             the country to set
     */
    public void setCountry(String country)
    {
        this.country = country;
    }

    /**
     * @param phone
     *             the phone to set
     */
    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String register()
    {
        this.loginBean.setUser(new Client(username, password, new ContactDetails(firstname, lastname, email, address, city, county, postcode, country, phone)));

        return "home_client" + REDIRECT;
    }
}

Here is the login form from login.xhtml:

<h:form>
        Username: <h:inputText value="#{loginBean.username}" />
    <br />
        Password: <h:inputSecret value="#{loginBean.password}" />
    <br />
    <h:commandButton value="Login" action="#{loginBean.nextPage}" />
    <h:commandLink value="I'm a new client" action="register"></h:commandLink>
</h:form>

And the register form from register.xhtml:

<h:form>
    <h:outputText value="Inregistrare client nou"/>
    <br/>
    Username: <h:inputText value="#{registerBean.username}">
        <f:validator validatorId="registerUsernameValidator"></f:validator>
    </h:inputText>
    <br/>
    Parola: <h:inputSecret value="#{registerBean.password}"></h:inputSecret>
    <br/>
    Re-Parola: <h:inputSecret value="#{registerBean.repassword}"></h:inputSecret>
    <br/>
    <br/>

    Prenume: <h:inputText value="#{registerBean.firstname}"></h:inputText>
    <br/>
    Nume: <h:inputText value="#{registerBean.lastname}"></h:inputText>
    <br/>
    E-mail: <h:inputText value="#{registerBean.email}"></h:inputText>
    <br/>
    Adresa: <h:inputText value="#{registerBean.address}"></h:inputText>
    <br/>
    Oras: <h:inputText value="#{registerBean.city}"></h:inputText>
    <br/>
    Judet: <h:inputText value="#{registerBean.county}"></h:inputText>
    <br/>
    Cod postal: <h:inputText value="#{registerBean.postcode}"></h:inputText>
    <br/>
    Tara: <h:inputText value="#{registerBean.country}"></h:inputText>
    <br/>
    Telefon: <h:inputText value="#{registerBean.phone}"></h:inputText>
    <br/>
    <br/>
    <h:commandButton value="Inregistreaza-ma"


action="#{registerBean.register}"></h:commandButton>

Our custom RegisterUsernameValidator:

public class RegisterUsernameValidator implements Validator
{
    UserManager um  = UserManager.getInstance();

    @Override
    public void validate(FacesContext context, UIComponent arg1, Object value) throws ValidatorException
    {
        String username = (String) value;
        if (!um.isUsernameAvailable(username))
        {
            FacesMessage facesMessage = new FacesMessage("Username indisponibil");
            FacesContext.getCurrentInstance().addMessage("Username indisponibil", facesMessage);
        }
    }
}

And the validation part from faces-config.xml:

<validator>
    <validator-id>registerUsernameValidator</validator-id>
    <validator-class>validation.RegisterUsernameValidator</validator-class>
</validator>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:01:54+00:00Added an answer on May 20, 2026 at 1:01 am

    com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed bean registerBean

    This means that processing the bean properties on RegisterBean directly after its construction has failed miserably due to a developer error (wrong configuration, inaccessible properties, invalid property type, etc). The root cause of the problem should be visible as root cause part in the stacktrace of the exception. Since you didn’t share the entire stacktrace, it’s hard to tell what exactly is failing.

    Anyway, just read the stacktrace. The answer is in there.


    Update: as per the full stacktrace:

    Caused by: com.sun.faces.mgbean.ManagedBeanPreProcessingException: Unexpected error processing managed property loginBean
    Caused by: java.lang.NullPointerException

    The managed property for loginBean could not be set in registerBean. Verify if there is a setter in RegisterBean class and it has the right signature.

    public void setLoginBean(LoginBean loginBean) {
        this.loginBean = loginBean;
    }
    

    Unrelated to the concrete problem, this NullPointerException should really have been a PropertyNotWritableException. What JSF impl/version are you using?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help with this exersise? Write a program which asks the user for
Can anyone help with this... vector<unsigned int> *vVec = new vector<unsigned int>; vVec .reserve(frankReservedSpace);
Can anyone help convert this this actionscript to Objective-c? if(mcMain.y >= stage.stageHeight - mcMain.height)
Can anyone help in this php page navigation script switch on counting normal serial
Can anyone help me with this error? alt text http://abbeylegal.com/downloads/parsererror.jpg full image here It
Can anyone help me to do this in the right way?I mean.. like that
Can anyone help me getting started with this? We have a current keygen for
Can anyone help me with reversing this PHP page navigation? Current script setting shows
Can anyone help with with the time complexity of this algorithm, and why it
Can anyone help me spot the problem on this PLEASE? I'm eternally grateful for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.