java.lang.ClassCastException: java.lang.String cannot be cast to br.com.estagio.beans.Cidade

com.br | 7 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    [JSF] java.lang.ClassCastException: java.lang.String cannot be cast to br.com.estagio.beans.Cid - Fórum DevMedia

    com.br | 7 months ago
    java.lang.ClassCastException: java.lang.String cannot be cast to br.com.estagio.beans.Cidade

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.lang.String cannot be cast to br.com.estagio.beans.Cidade

      at br.com.estagio.conversores.ConverterCidade.getAsString()
    2. br.com.estagio
      ConverterCidade.getAsString
      1. br.com.estagio.conversores.ConverterCidade.getAsString(ConverterCidade.java:37)
      1 frame
    3. JSF
      MenuRenderer.encodeEnd
      1. com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getFormattedValue(HtmlBasicRenderer.java:521)
      2. com.sun.faces.renderkit.html_basic.MenuRenderer.renderOption(MenuRenderer.java:534)
      3. com.sun.faces.renderkit.html_basic.MenuRenderer.renderOptions(MenuRenderer.java:794)
      4. com.sun.faces.renderkit.html_basic.MenuRenderer.renderSelect(MenuRenderer.java:847)
      5. com.sun.faces.renderkit.html_basic.MenuRenderer.encodeEnd(MenuRenderer.java:297)
      5 frames
    4. JavaEE 7
      UIComponent.encodeAll
      1. javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919)
      2. javax.faces.component.UIComponent.encodeAll(UIComponent.java:1864)
      3. javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
      4. javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889)
      5. javax.faces.component.UIComponent.encodeAll(UIComponent.java:1857)
      6. javax.faces.component.UIComponent.encodeAll(UIComponent.java:1860)
      6 frames
    5. JSF
      LifecycleImpl.render
      1. com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:461)
      2. com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133)
      3. com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
      4. com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
      5. com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
      5 frames
    6. JavaEE 7
      FacesServlet.service
      1. javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
      1 frame
    7. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      2 frames
    8. Tomcat WS
      WsFilter.doFilter
      1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      1 frame
    9. Glassfish Core
      CoyoteAdapter.service
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
      3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
      4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
      5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
      6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
      7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
      9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
      10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
      10 frames
    10. Grizzly HTTP
      JIoEndpoint$SocketProcessor.run
      1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
      2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
      3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
      3 frames
    11. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      3. java.lang.Thread.run(Unknown Source)
      3 frames