An error occurred while performing resource injection in the managed state beanController

-1

When I try to run java, this error occurs.

I'll send the code.

MODEL:

package com.pi.drogaria.model;

import javax.persistence.Column;
import javax.persistence.Entity;

@SuppressWarnings("serial")
@Entity
public class Estado extends Codigo{

    @Column(length = 2, nullable = false)
    private String sigla;

    @Column(length = 50, nullable = false)
    private String nome;

    public String getSigla() {
        return sigla;
    }

    public void setSigla(String sigla) {
        this.sigla = sigla;
    }

    public String getNome() {
        return nome;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }
}

CONTROLLER:

package com.pi.drogaria.controller;

import java.io.Serializable;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;

import org.omnifaces.util.Messages;

import com.pi.drogaria.DAO.EstadoDAO;
import com.pi.drogaria.model.Estado;

@SuppressWarnings("serial")
@ManagedBean
@ViewScoped
public class EstadoController implements Serializable {
    private Estado estado;
    private List<Estado> estados;

    public Estado getEstado() {
        return estado;
    }

    public void setEstado(Estado estado) {
        this.estado = estado;
    }

    public List<Estado> getEstados() {
        return estados;
    }

    public void setEstados(List<Estado> estados) {
        this.estados = estados;
    }

    @PostConstruct
    public void listar() {
        try {
            EstadoDAO estadoDAO = new EstadoDAO();
            estados = estadoDAO.listar();
        } catch (RuntimeException erro) {
            Messages.addGlobalError("Erro ao listar estados.");
            erro.printStackTrace();
        }
    }

    public void novo() {
        estado = new Estado();
            estados = new ArrayList<>();
    }

    public void salvar() {
        try {
            EstadoDAO estadoDAO = new EstadoDAO();
            estadoDAO.merge(estado);
            novo();
            estados = estadoDAO.listar();
            Messages.addGlobalInfo("Estado salvo com sucesso.");
        } catch (RuntimeException erro) {
            Messages.addGlobalError("Erro ao salvar estado.");
            erro.printStackTrace();
        }
    }

    public void excluir(ActionEvent evento) {
        try {
            estado = (Estado) evento.getComponent().getAttributes().get("estadoSelecionado");
            EstadoDAO estadoDAO = new EstadoDAO();
            estadoDAO.excluir(estado);
            estados = estadoDAO.listar();
            Messages.addGlobalInfo("Estado removido com sucesso");
        } catch (RuntimeException erro) {
            Messages.addGlobalError("Ocorreu erro ao tentar remover");
            erro.printStackTrace();
        }
    }

    public void editar(ActionEvent evento){
        estado = (Estado) evento.getComponent().getAttributes().get("estadoSelecionado");
    }
}

VIEW:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://xmlns.jcp.org/jsf/core" xmlns:p="http://primefaces.org/ui">

<h:head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>Estados</title>
</h:head>

<h:body>

  <p:growl id="mensagem" />

  <h:form id="formListagem">

    <p:panel header="Estados - Listagem">
      <p:dataTable id="tabela" emptyMessage="Nenhum registro encontrado." paginator="true" value="#{EstadoController.estados}" var="estado" rows="5">
        <f:facet name="header">
          <p:commandButton value="Novo" oncomplete="PF('dialogo').show();" actionListener="#{EstadoController.novo}" update=":formCadastro:painel" />
        </f:facet>

        <p:column headerText="Nome" filterBy="#{estado.nome}">
          <h:outputText value="#{estado.nome}" />
        </p:column>

        <p:column headerText="Sigla" filterBy="#{estado.sigla}">
          <h:outputText value="#{estado.sigla}" />
        </p:column>

        <p:column headerText="Opções">
          <p:commandButton icon="ui-icon-trash" actionListener="#{EstadoController.excluir}" update=":mensagem :formListagem:tabela">
            <p:confirm header="Confirmação" message="Deseja excluir o estado?" icon="ui-icon-alert" />
            <f:attribute name="estadoSelecionado" value="#{estado}" />
          </p:commandButton>

          <p:commandButton icon="ui-icon-pencil" actionListener="#{EstadoController.editar}" update=":formCadastro:painel" oncomplete="PF('dialogo').show();">
            <f:attribute name="estadoSelecionado" value="#{estado}" />
          </p:commandButton>

        </p:column>

      </p:dataTable>

      <p:confirmDialog global="true">
        <p:commandButton value="Sim" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
        <p:commandButton value="Não" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
      </p:confirmDialog>

    </p:panel>
  </h:form>

  <p:dialog header="Estados - Cadastro" widgetVar="dialogo" draggable="false" resizable="false" modal="true" closable="false">
    <h:form id="formCadastro">

      <h:panelGrid id="painel" columns="2">
        <p:outputLabel value="Nome:" />
        <p:inputText maxlength="50" size="30" value="#{EstadoController.estado.nome}" />

        <p:outputLabel value="Sigla:" />
        <p:inputText maxlength="2" size="10" value="#{EstadoController.estado.sigla}" />
      </h:panelGrid>

      <h:panelGrid columns="2">

        <p:commandButton value="Salvar" actionListener="#{EstadoController.salvar}" update=":mensagem :formCadastro:painel :formListagem:tabela" />
        <p:commandButton value="Fechar" oncomplete="PF('dialogo').hide();" />

      </h:panelGrid>
    </h:form>
  </p:dialog>
</h:body>

</html>

ERROR:

  com.sun.faces.mgbean.ManagedBeanCreationException: Um erro ocorreu ao realizar a injeção de recurso no bean gerenciado estadoController
    at com.sun.faces.mgbean.BeanBuilder.invokePostConstruct(BeanBuilder.java:227)
    at com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:103)
    at com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:409)
    at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:269)
    at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
    at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
    at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
    at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
    at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:94)
    at org.apache.el.parser.AstValue.getValue(AstValue.java:137)
    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:190)
    at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109)
    at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
    at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
    at javax.faces.component.UIData.getValue(UIData.java:732)
    at org.primefaces.component.api.UIData.getDataModel(UIData.java:764)
    at javax.faces.component.UIData.getRowCount(UIData.java:356)
    at org.primefaces.component.api.UIData.calculateFirst(UIData.java:215)
    at org.primefaces.component.datatable.DataTableRenderer.preRender(DataTableRenderer.java:186)
    at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:90)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
    at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:89)
    at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:72)
    at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:206)
    at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:123)
    at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:58)
    at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:920)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863)
    at javax.faces.render.Renderer.encodeChildren(Renderer.java:176)
    at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:890)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859)
    at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458)
    at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134)
    at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:337)
    at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.sun.faces.spi.InjectionProviderException
    at com.sun.faces.vendor.WebContainerInjectionProvider.invokeAnnotatedMethod(WebContainerInjectionProvider.java:115)
    at com.sun.faces.vendor.WebContainerInjectionProvider.invokePostConstruct(WebContainerInjectionProvider.java:95)
    at com.sun.faces.mgbean.BeanBuilder.invokePostConstruct(BeanBuilder.java:221)
    ... 60 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.sun.faces.vendor.WebContainerInjectionProvider.invokeAnnotatedMethod(WebContainerInjectionProvider.java:113)
    ... 62 more
Caused by: java.lang.ExceptionInInitializerError
    at com.pi.drogaria.util.HibernateUtil.criarFabricaDeSessoes(HibernateUtil.java:24)
    at com.pi.drogaria.util.HibernateUtil.<clinit>(HibernateUtil.java:9)
    at com.pi.drogaria.DAO.DAOGenerico.listar(DAOGenerico.java:41)
    at com.pi.drogaria.controller.estadoController.listar(estadoController.java:43)
    ... 67 more
Caused by: org.hibernate.HibernateException: Error accessing stax stream
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:107)
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:65)
    at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:57)
    at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:163)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:258)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:244)
    at com.pi.drogaria.util.HibernateUtil.criarFabricaDeSessoes(HibernateUtil.java:17)
    ... 70 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[29,36]
Message: Fim prematuro do arquivo.
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)
    at com.sun.xml.internal.stream.XMLEventReaderImpl.peek(Unknown Source)
    at org.hibernate.boot.cfgxml.internal.JaxbCfgProcessor.unmarshal(JaxbCfgProcessor.java:103)
    ... 76 more

CLASS CODE:

package com.pi.drogaria.model;

import java.io.Serializable;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

    @SuppressWarnings("serial")
    @MappedSuperclass
    public class Codigo implements Serializable {

        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long codigo;

        public Long getCodigo() {
            return codigo;
        }

        public void setCodigo(Long codigo) {
            this.codigo = codigo;
        }

        public String ToString() {
            return String.format("%s[codigo=%d]", getClass().getSimpleName(), getCodigo());
        }

    }

HIBERNATE UTIL:

public class HibernateUtil {
private static SessionFactory fabricaDeSessoes = criarFabricaDeSessoes();

public static SessionFactory getFabricaDeSessoes() {
    return fabricaDeSessoes;
}

private static SessionFactory criarFabricaDeSessoes() {
    try {
        StandardServiceRegistry standardRegistry = 
                new StandardServiceRegistryBuilder().configure("hibernate.cfg.xml").build();
        Metadata metaData = 
                new MetadataSources(standardRegistry).getMetadataBuilder().build();
        fabricaDeSessoes = metaData.getSessionFactoryBuilder().build();
    } catch (Throwable th) {
        System.err.println("A fábrica de sessões não pode ser criada." + th);
        throw new ExceptionInInitializerError(th);
    }
    return fabricaDeSessoes;
}

HIBERNATE.CFG.XML:

<hibernate-configuration>

<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/postgres</property>
<property name="hibernate.connection.username">postgres</property>
<property name="hibernate.connection.password">12345</property>

<property name="show_sql">true</property>
<property name="hbm2ddl.auto">create</property>
<property name="format_sql">false</property>

<mapping class="com.pi.drogaria.model.Cidade"/>
<mapping class="com.pi.drogaria.model.Cliente"/>
<mapping class="com.pi.drogaria.model.Estado"/>
<mapping class="com.pi.drogaria.model.Fabricante"/>
<mapping class="com.pi.drogaria.model.Funcionario"/>
<mapping class="com.pi.drogaria.model.ItemVenda"/>
<mapping class="com.pi.drogaria.model.Pessoa"/>
<mapping class="com.pi.drogaria.model.Produto"/>
<mapping class="com.pi.drogaria.model.Usuario"/>
<mapping class="com.pi.drogaria.model.Venda"/>

ERROR TO TRY TO SAVE A STATE:

    ago 17, 2018 9:26:16 PM com.sun.faces.lifecycle.ProcessValidationsPhase execute
ADVERTÊNCIA: /pages/estados.xhtml @75,48 value="#{EstadoController.estado.nome}": Target Unreachable, identifier 'EstadoController' resolved to null
javax.el.PropertyNotFoundException: /pages/estados.xhtml @75,48 value="#{EstadoController.estado.nome}": Target Unreachable, identifier 'EstadoController' resolved to null
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
    at org.primefaces.util.ComponentUtils.getConverter(ComponentUtils.java:146)
    at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:176)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1045)
    at javax.faces.component.UIInput.validate(UIInput.java:975)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1248)
    at javax.faces.component.UIInput.processValidators(UIInput.java:712)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIForm.processValidators(UIForm.java:253)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at org.primefaces.component.dialog.Dialog.processValidators(Dialog.java:424)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'EstadoController' resolved to null
    at org.apache.el.parser.AstValue.getTarget(AstValue.java:74)
    at org.apache.el.parser.AstValue.getType(AstValue.java:58)
    at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:174)
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
    ... 38 more

ago 17, 2018 9:26:16 PM com.sun.faces.context.AjaxExceptionHandlerImpl handlePartialResponseError
GRAVE: javax.el.PropertyNotFoundException: /pages/estados.xhtml @75,48 value="#{EstadoController.estado.nome}": Target Unreachable, identifier 'EstadoController' resolved to null
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100)
    at org.primefaces.util.ComponentUtils.getConverter(ComponentUtils.java:146)
    at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:176)
    at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1045)
    at javax.faces.component.UIInput.validate(UIInput.java:975)
    at javax.faces.component.UIInput.executeValidate(UIInput.java:1248)
    at javax.faces.component.UIInput.processValidators(UIInput.java:712)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIForm.processValidators(UIForm.java:253)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at org.primefaces.component.dialog.Dialog.processValidators(Dialog.java:424)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1261)
    at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1195)
    at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76)
    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:658)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1152)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'EstadoController' resolved to null
    at org.apache.el.parser.AstValue.getTarget(AstValue.java:74)
    at org.apache.el.parser.AstValue.getType(AstValue.java:58)
    at org.apache.el.ValueExpressionImpl.getType(ValueExpressionImpl.java:174)
    at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:98)
    ... 38 more
    
asked by anonymous 08.08.2018 / 05:10

1 answer

1

Try to do this:

  • in your stateController class, start the name of a class always with a capital letter;
  • Initialize your state and state variables, you can do this in the constructor method because it will always run when an object of this class is instantiated, here is an example of how you can do this:
  • I saw that you created a method called new () that you use to clear the data in the form, right?

    public void novo() {
      estado = new Estado();
      estados = new ArrayList<>(); //adicione essa linha para limpar a lista de estados
    }
    

    Create a compelling method in your StateController class

    //Aqui, seguindo a padronização, já considerei a classe iniciada com letra maiuscula
    public EstadoController(){
      //chama o método novo
      novo();
    }
    

    Make these changes and speak the result, because as you said that you formatted the computer and that before it worked could have other problems.

        
    17.08.2018 / 15:36