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

  • Home
  • SEARCH
  • 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 8281391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:01:07+00:00 2026-06-08T10:01:07+00:00

In my webapp, when I click on the login link, the Tomcat webserver throws

  • 0

In my webapp, when I click on the login link, the Tomcat webserver throws the following exception:

exception
javax.servlet.ServletException: /aluno_jsf.xhtml: Property 'logout' not found on type
br.com.aluno.controller.LoginMB

javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)

root cause
javax.el.ELException: /aluno_jsf.xhtml: Property 'logout' not found on type
br.com.aluno.controller.LoginMB
[...]

Here’s my @ManagedBean:

package br.com.aluno.controller;

import java.io.Serializable;
import java.util.Collection;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.context.FacesContext;
import javax.servlet.http.HttpSession;
import br.com.aluno.dao.DaoFactory;
import br.com.aluno.entity.Usuario;
import br.com.aluno.util.JsfUtil;

@ManagedBean
public class LoginMB implements Serializable {
private static final long serialVersionUID = 6667329439219329074L;

private Usuario usuario;

@PostConstruct
public void init() {
    usuario = new Usuario();
}

public void logar() {
    try {
        Collection<Usuario> usuarios = DaoFactory
                .getDAOFactory(DaoFactory.JPA).getUsuarioDao()
                .validarLogin(usuario);
        if (usuarios != null && usuarios.size() == 1) {

            usuario = usuarios.iterator().next();

            HttpSession session = (HttpSession) FacesContext
                    .getCurrentInstance().getExternalContext()
                    .getSession(true);
            if (session != null) {
                session.setAttribute("usuario", usuario);
                session.setAttribute("usuarioTipo", usuario.getClass()
                        .getName());
            }
        } else {
            JsfUtil.addErrorMessage("Login ou senha invalida",
                    "Login ou senha invalida");
        }
    } catch (Exception e) {
        JsfUtil.addFatalMessage("Entre em contato com o administrador",
                e.getMessage());
    }
}

public String logout() {
    HttpSession session = (HttpSession) FacesContext.getCurrentInstance()
            .getExternalContext().getSession(false);
    if (session != null) {
        session.invalidate();
    }
    return "/login?faces-redirect=true";
}

public Usuario getUsuario() {
    return usuario;
}

public void setUsuario(Usuario usuario) {
    this.usuario = usuario;
}
}

I have a link in a index.html which redirects to the following login.xhtml:

<ui:decorate xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" template="/aluno_jsf.xhtml">

<ui:define name="conteudo">
    <h:form rendered="#{sessionScope.usuario == null}">
        <h3>Login</h3>
        <p:messages id="messages" showDetail="true" autoUpdate="true" />
        <h:panelGrid columns="2">
            <p:outputLabel for="login" value="Login:" />
            <p:inputText id="login" value="#{loginMB.usuario.login}" required="true" 
requiredMessage="Digite um login" />
            <p:outputLabel for="senha" value="Senha:" />
            <p:password id="senha" value="#{loginMB.usuario.senha}" required="true" 
requiredMessage="Digite uma senha" />
            <p:commandButton action="#{loginMB.logar}" value="Logar" ajax="false" />
        </h:panelGrid>
    </h:form>
</ui:define>

After validation, the following pages should be rendered:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui" >
<h:head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>aluno_jsf</title>
</h:head>
<h:body>
<f:view>
    <h:form>
        <p:menubar
            rendered="#{sessionScope.usuarioTipo == 'br.com.aluno.entity.Administrador'}">
            <p:menuitem url="/administrador/cadastroCurso.xhtml"
value="Cadastro de curso" />
            <p:menuitem url="/administrador/cadastroDisciplina.xhtml" 
value="Cadastro de disciplinas" />
            <p:menuitem url="/administrador/cadastroAluno.xhtml" 
value="Cadastro de alunos" />
            <p:menuitem url="/administrador/atribuiNota.xhtml" 
value="Atribuicao de notas para alunos" />
            <p:menuitem action="#{loginMB.logout}" value="Logout" />
        </p:menubar>
        <p:menubar
rendered="#{sessionScope.usuarioTipo == 'br.com.aluno.entity.Aluno'}">
            <p:menuitem url="/aluno/nota.xhtml" value="Consulta de notas" />
            <p:menuitem url="/aluno/senha.xhtml" value="Alteracao de senha" />
            <p:menuitem action="#{loginMB.logout}" value="Logout" />
        </p:menubar>
    </h:form>
    <ui:insert name="conteudo">
    conteudo
    </ui:insert>
</f:view>
</h:body>
</html>

Since I’m adapting this web app – and I’ve already got some misconfigurations before – does anyone knows what’s happening now?

Thanks in advance.

As you asked, her’s the new exception:

message Could not initialize class br.com.fiap.aluno.util.JpaUtil

description The server encountered an internal error (Could not initialize class     br.com.fiap.aluno.util.JpaUtil) that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Could not initialize class br.com.fiap.aluno.util.JpaUtil
javax.faces.webapp.FacesServlet.service(FacesServlet.java:422)

root cause

java.lang.NoClassDefFoundError: Could not initialize class br.com.fiap.aluno.util.JpaUtil
br.com.fiap.aluno.dao_jpa.JpaUsuarioDao.validarLogin(JpaUsuarioDao.java:46)
br.com.fiap.aluno.controller.LoginMB.logar(LoginMB.java:30)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:601)
javax.el.BeanELResolver.invoke(BeanELResolver.java:484)
javax.el.CompositeELResolver.invoke(CompositeELResolver.java:161)
org.apache.el.parser.AstValue.getValue(AstValue.java:159)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:189)
com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:214)
com.sun.faces.facelets.compiler.AttributeInstruction.write(AttributeInstruction.java:89)
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
    com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759)
  com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401)
com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)

note The full stack trace of the root cause is available in the Apache Tomcat/7.0.29 logs.

I’ll try to fix it, but I appreciate if you could give some hints.

  • 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-06-08T10:01:09+00:00Added an answer on June 8, 2026 at 10:01 am

    javax.el.ELException: /aluno_jsf.xhtml: Property ‘logout’ not found on type
    br.com.aluno.controller.LoginMB

    This suggests that the #{loginMB.logout} is been evaluated as a ValueExpression instead of as a MethodExpression.

    That can for example happen if you’re using <h:outputText value="#{loginMB.logout}" />, or even when the x namespace behind <x:someComponent action="#{loginMB.logout}" /> can’t be resolved due to missing or incorrect XML namespace declaration or the JAR file containing the components not being included in the runtime classpath.

    The cause is not visible in the code posted so far, but with my best guess you’re not using Facelets templating properly. The code shows strange use case of <ui:decorate>. Head to this answer to learn how to properly use template compositions: How to include another XHTML in XHTML using JSF 2.0 Facelets?

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

Sidebar

Related Questions

multiple webapp running on same tomcat using same jvm. sometime, one webapp that have
I'm trying to build a mobile HTML5 webapp in which user can click on
I'm working with a webapp that has a link to download an xml file.
When i click on login, it checks the DB if there is a value
I'm using the following login form in my web app. It works fine in
All the variations of wait(...) are throwing the below exception from the following code.
I am developing a WebApp in PHP. The user will be able to click
I'm trying to deploy new web application in Tomcat 6.0, but whenever I click
Whenever i click on the link created by users.create_login_url() , i get an error
I'm trying to enable functionality in my web app to allow users to click

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.