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 8522499
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:08:12+00:00 2026-06-11T07:08:12+00:00

I’m trying to load the selectOneMenu and gives the following exception: java.lang.IllegalStateException: Cannot create

  • 0

I’m trying to load the selectOneMenu and gives the following exception: java.lang.IllegalStateException: Cannot create a session after the response has been committed.
I have the xhtml:

<h:outputText value="Nome:" />
 <p:selectOneMenu value="" id="nome"  >
   <f:selectItem itemValue="#{solicitarPortabilidadeBean.listaDoadora}" var="doadora" itemLabel="#{doadora.nomeOperadora}"/>                
 </p:selectOneMenu>

the bean:

@ViewScoped
@ManagedBean
public class SolicitarPortabilidadeBean implements Serializable {

  private static final long serialVersionUID = 1L;  
  private List<Operadora> listaDoadora = null;
  private Operadora operadora;
//getters and setters

  @EJB
  private ConsultasSpnService consultaOp;   

  public List<Operadora> getListaDoadora() {

if (listaDoadora == null) {

 listaDoadora = new ArrayList<Operadora>();
 listaDoadora = consultaOp.listarOp();          

}   

return listaDoadora;
    }

public void setListaDoadora(List<Operadora> listaDoadora) {
    this.listaDoadora = listaDoadora;
}

public Operadora getOperadora() {
    return operadora;
}

public void setOperadora(Operadora operadora) {
    this.operadora = operadora;
}

public List<Eot> getListaEot() {
    return listaEot;
}

public void setListaEot(List<Eot> listaEot) {
    this.listaEot = listaEot;
}

public Eot getEot() {
    return eot;
}

public void setEot(Eot eot) {
    this.eot = eot;
}

public ConsultasSpnService getConsultaOp() {
    return consultaOp;
}

public void setConsultaOp(ConsultasSpnService consultaOp) {
    this.consultaOp = consultaOp;
}   

}

the Operadora class:

public class Operadora {
 private String srvprovid = null;   
 private String nomeOperadora = null;   
 private String indicadorFuncoes = null;
 private String funcaoSuporte = null;
 private String tipoTempReceptora = null;
 private String tipoTempDoadora = null;
 private String horaTrabSuportado = null;
 private Long qtdMaximaTn = null;
 private String tipoServico = null;
 //getters and setters
public String getSrvprovid() {
        return srvprovid;
    }
    public void setSrvprovid(String srvprovid) {
        this.srvprovid = srvprovid;
    }
    public String getNomeOperadora() {
        return nomeOperadora;
    }
    public void setNomeOperadora(String nomeOperadora) {
        this.nomeOperadora = nomeOperadora;
    }
    public String getIndicadorFuncoes() {
        return indicadorFuncoes;
    }
    public void setIndicadorFuncoes(String indicadorFuncoes) {
        this.indicadorFuncoes = indicadorFuncoes;
    }
    public String getFuncaoSuporte() {
        return funcaoSuporte;
    }
    public void setFuncaoSuporte(String funcaoSuporte) {
        this.funcaoSuporte = funcaoSuporte;
    }
    public String getTipoTempReceptora() {
        return tipoTempReceptora;
    }
    public void setTipoTempReceptora(String tipoTempReceptora) {
        this.tipoTempReceptora = tipoTempReceptora;
    }
    public String getTipoTempDoadora() {
        return tipoTempDoadora;
    }
    public void setTipoTempDoadora(String tipoTempDoadora) {
        this.tipoTempDoadora = tipoTempDoadora;
    }
    public String getHoraTrabSuportado() {
        return horaTrabSuportado;
    }
    public void setHoraTrabSuportado(String horaTrabSuportado) {
        this.horaTrabSuportado = horaTrabSuportado;
    }
    public Long getQtdMaximaTn() {
        return qtdMaximaTn;
    }
    public void setQtdMaximaTn(Long qtdMaximaTn) {
        this.qtdMaximaTn = qtdMaximaTn;
    }
    public String getTipoServico() {
        return tipoServico;
    }
    public void setTipoServico(String tipoServico) {
        this.tipoServico = tipoServico;
    }

I know the error is in calling the bean inside the xhtml, but I tried everything I knew. Can anyone help me?

Thank you!!!

  • 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-11T07:08:14+00:00Added an answer on June 11, 2026 at 7:08 am

    Apart from severe logic errors in the code, which should in turn however not have thrown any exception during rendering at all, for sure not particularly the mentioned exception,

    IllegalStateException: Cannot create a session after the response has been committed

    your concrete problem is most likely caused by a bug in Mojarra which is fixed in Mojarra 2.1.8. This bug can manifest when a view scoped or session scoped bean is referenced for the first time "late" in a relatively large JSF page, long after the response has been committed.

    View and session scoped beans needs to be stored in the HTTP session. For that, the HTTP session needs to be created first, if not done yet (e.g. first-time request). For that, a cookie needs to be put on the HTTP response headers first. For that, the response should not have been sent to the client at all. The default response buffer size is usually 2KB, so if a page is larger than 2KB and the view or session scoped bean is referenced for the first time after the first piece of 2KB, then you will get exactly this exception.

    Upgrade to at least Mojarra 2.1.8 (it’s currently already at 2.1.13) and this problem should disappear.

    See also:

    • Adding <h:form> causes java.lang.IllegalStateException: Cannot create a session after the response has been committed
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to render a haml file in a javascript response like so:
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.