Null Pointer em Converter ! [RESOLVIDO]

Boa noite !, com um probleminha quta me deixando com dor de cabeça já, olhem só

tenho um converter que faz uma busca por ID, mas ele ta retornando null, o curioso eh que tenho ooutro converter que funciona perfeitamente, utilizando a mesma busca por ID minhas classes:

AUTORIZACOES

@Entity
@Table(uniqueConstraints = {
    @UniqueConstraint(columnNames = "descricao")})
public class Autorizacao implements Serializable, Modelo<Integer> {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    private Integer id;

    private String descricao;

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "autorizacao")
    private List<UsuarioAutorizacao> autorizacaoDeUsuarios;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    /**
     * @return the autorizacaoDeUsuarios
     */
    public List<UsuarioAutorizacao> getAutorizacaoDeUsuarios() {
        return autorizacaoDeUsuarios;
    }

    /**
     * @param autorizacaoDeUsuarios the autorizacaoDeUsuarios to set
     */
    public void setAutorizacaoDeUsuarios(List<UsuarioAutorizacao> autorizacaoDeUsuarios) {
        this.autorizacaoDeUsuarios = autorizacaoDeUsuarios;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((descricao == null) ? 0 : descricao.hashCode());
        result = prime * result + ((id == null) ? 0 : id.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        Autorizacao other = (Autorizacao) obj;

        if (descricao == null) {
            if (other.descricao != null) {
                return false;
            }
        } else if (!descricao.equals(other.descricao)) {
            return false;
        }
        if (id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!id.equals(other.id)) {
            return false;
        }
        return true;
    }

}

AutorizacaoDAO

public interface AutorizacaoDAO  extends  IDAO<Autorizacao, Integer>{
    
}

AutorizacaoJPADAO

@Repository
@Transactional
public class AutorizacaoJPADAO extends GenericJPADAO<Autorizacao, Integer> implements AutorizacaoDAO {

    public AutorizacaoJPADAO() {
        super(Autorizacao.class);
    }
}

GenericJPADAO

@Repository
@Transactional
public class GenericJPADAO<T extends Modelo<ID>, ID> implements IDAO<T, ID> {

    @PersistenceContext
    private EntityManager em;

    private Class<T> clazz;

    public EntityManager getEm() {
        return em;
    }

    /**
     * Construtor esperando o clazz da Entity da classe filha *
     */
    public GenericJPADAO(Class<T> clazz) {
        this.clazz = clazz;
    }

    public GenericJPADAO() {
    }

    
    public T buscarPorId(ID id) throws DAOException {

        try {
            return em.find(clazz, id);
        } catch (Exception e) {
            throw new DAOException("Não foi possível fazer a busca", e);
        }
    }

    
    public List<T> buscarTodos() throws DAOException {

        try {
            String nomeDaClass = clazz.getSimpleName();
            Query query = em.createQuery("select a FROM " + nomeDaClass + " a ");
            return query.getResultList();
        } catch (Exception e) {
            throw new DAOException("Não foi possível fazer a busca", e);
        }
    }

    @Transactional
    public void salvar(T o) throws DAOException {
        try {
            em.merge(o);
        } catch (Exception e) {
            throw new DAOException("Não foi possível salvar.", e);
        }
    }

    @Transactional
    public void excluir(T o) throws DAOException {
        try {
            o = buscarPorId(o.getId());
            em.remove(o);
        } catch (Exception e) {
            e.printStackTrace();
            throw new DAOException("Não foi possível excluir.", e);
        }
    }
}

AutorizacaoService

public interface AutorizacaoService extends IService<Autorizacao, Integer> {

}

AutorizacaoServiceImpl

@Service
@Transactional
public class AutorizacaoServiceImpl extends GenericServiceImpl<Autorizacao, Integer> implements AutorizacaoService {

    @Autowired //Injetavel
    private AutorizacaoDAO autorizacaoDAO;

    @Override
    public IDAO<Autorizacao, Integer> getDAO() {
        return autorizacaoDAO;
    }

}

GenericServiceImpl

@Service
public abstract class GenericServiceImpl<T,ID> implements IService<T, ID> {
	/** Método para acessar uma implementacao de IDAO **/
	public abstract IDAO<T, ID> getDAO();
	
	
	public void salvar(T o) throws ServiceException {
		try {
			getDAO().salvar(o);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}

	
	public void excluir(T o) throws ServiceException {
		try {
			getDAO().excluir(o);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}

	
	public T buscarPorId(ID id) throws ServiceException {
		try {
			return getDAO().buscarPorId(id);
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}

	
	public List<T> buscarTodos() throws ServiceException {
		try {
			return getDAO().buscarTodos();
		} catch (DAOException e) {
			e.printStackTrace();
			throw new ServiceException(e);
		}
	}

}

@FacesConverter("autorizacoesConverter")
@Component
public class AutorizacaoConverter implements Converter {

    @Autowired
    AutorizacaoService autorizacaoService;

    
    public AutorizacaoConverter() {
        autorizacaoService = new AutorizacaoServiceImpl();
    }

    //@Inject
    @Override
    public Object getAsObject(FacesContext arg0, UIComponent arg1, String id) {
        if (id == null || id.equals("")) {
            return null;
        }
        try {

            //Tentando Converter
            Integer idAutorizacao = Integer.parseInt(id);
            //Tentando buscar por id
            // aqui da null pointer quando executa a busca por id
            Autorizacao autorizacao = autorizacaoService.buscarPorId(idAutorizacao);
            return autorizacao;
        } catch (NumberFormatException e) {
            //e.printStackTrace();
            return null;

        } catch (ServiceException e) {
            //	e.printStackTrace();
            return null;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public String getAsString(FacesContext arg0, UIComponent arg1, Object objeto) {
        try {
            Autorizacao autorizacao = (Autorizacao) objeto;
            return autorizacao.getId().toString();
        } catch (Exception e) {
            //e.printStackTrace();
            return null;
        }
    }

}

já nem sei o que fazer mais :confused: se alguem puder me ajudar, agradeço ! :frowning:

Cade o stacktrace?

putz esqueci :confused:

Stacktrace

java.lang.NullPointerException
	at br.ucdb.model.service.GenericServiceImpl.buscarPorId(GenericServiceImpl.java:39)
	at br.ucdb.web.controller.converter.AutorizacaoConverter.getAsObject(AutorizacaoConverter.java:48)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValues(MenuRenderer.java:513)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel(MenuRenderer.java:342)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(MenuRenderer.java:128)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:314)
	at org.primefaces.component.selectcheckboxmenu.SelectCheckboxMenuRenderer.getConvertedValue(SelectCheckboxMenuRenderer.java:36)
	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:1260)
	at javax.faces.component.UIForm.processValidators(UIForm.java:253)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	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:646)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:744)

Não tenho como saber exatamente qual é a linha exata que está gerando a exceção, mas acredito que seu método getDao() está retornando null no método buscarPorId da classe GenericServiceImpl

O problema é que eu tenho basicamente um mesmo esquema de classes , interfaces e controller do tipo Conta e ela funciona perfeitamete, fiz o debug e em Conta o objeto nao vem null já nesse outro vem null, achei que fosse problema no netbeans ai abri no eclipse e deu a mesma coisa, não sei mas nem o que é e ta me dando uma baita dor de cabeça :confused:

Então, você tem que analisar agora a partir daí, provavelmente é alguma configuração que está faltando.

UPDATE

Criei uma DAOFactory pra ver se carregav a marra o objeto, ele até que carrega, mas quando faz a busca lá vem o null pointer :confused:

DAOFactory

public class DAOFactory {

    private static AutorizacaoDAO autorizacaoDAO = null;


    /**
     * Design Pattern Singleton
     *
     * @return
     */

    public static AutorizacaoDAO getAutorizacaoDAO() {

        if (autorizacaoDAO == null) {
            autorizacaoDAO = new AutorizacaoJPADAO();
        }
        return autorizacaoDAO;
    }

}

ai no meu AutorizacaoServiceImpl, inicializaie no construtor:

public AutorizacaoServiceImpl() {
        autorizacaoDAO = DAOFactory.getAutorizacaoDAO();
    }

assim me dando esse null pointer !

Stacktrace gerado da ultima modificacao

br.ucdb.model.pesistencia.dao.exception.DAOException: Não foi possível fazer a busca
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:56)
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:26)
	at br.ucdb.model.service.GenericServiceImpl.buscarPorId(GenericServiceImpl.java:39)
	at br.ucdb.web.controller.converter.AutorizacaoConverter.getAsObject(AutorizacaoConverter.java:48)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValues(MenuRenderer.java:513)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel(MenuRenderer.java:342)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(MenuRenderer.java:128)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:314)
	at org.primefaces.component.selectcheckboxmenu.SelectCheckboxMenuRenderer.getConvertedValue(SelectCheckboxMenuRenderer.java:36)
	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:1260)
	at javax.faces.component.UIForm.processValidators(UIForm.java:253)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	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:646)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:54)
	... 76 more
br.ucdb.model.pesistencia.dao.exception.DAOException: Não foi possível fazer a busca
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:56)
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:26)
	at br.ucdb.model.service.GenericServiceImpl.buscarPorId(GenericServiceImpl.java:39)
	at br.ucdb.web.controller.converter.AutorizacaoConverter.getAsObject(AutorizacaoConverter.java:48)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValues(MenuRenderer.java:513)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValuesForModel(MenuRenderer.java:342)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue(MenuRenderer.java:128)
	at com.sun.faces.renderkit.html_basic.MenuRenderer.getConvertedValue(MenuRenderer.java:314)
	at org.primefaces.component.selectcheckboxmenu.SelectCheckboxMenuRenderer.getConvertedValue(SelectCheckboxMenuRenderer.java:36)
	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:1260)
	at javax.faces.component.UIForm.processValidators(UIForm.java:253)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1260)
	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:646)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:393)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
	at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
	at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:54)
	... 76 more

A anotação do seu converter está errado tb

@FacesConverter("autorizacoesConverter")

O correto é

@FacesConverter(Autorizacao.class)

De acordo com o stacktrace o erro está aqui

 at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:56)  

GenericJPADAO, na linha 56. Da uma olhada.

Quando ao @FacesConverter, as duas maneiras acima são corretas. Depende do seu propósito.

Eu estou vendo que vc está fazendo usando o springframework
Repare neste ponto

[code] @Autowired
AutorizacaoService autorizacaoService;

public AutorizacaoConverter() {  
    autorizacaoService = new AutorizacaoServiceImpl();  
}  [/code]

Voce tem um serio problema neste pronto, vc esta deixando de usar a injecao de dependencia e criando o servico com o new AutorizacaoServiceImpl(); quando vc cria um objeto na mão desta forma, sendo que dentro dele vc tem toda uma injeção de dependencia vc peder todo a injeção para o new AutorizacaoServiceImpl() e para os objetos dentre dele tb;

Se sua injeção de dependencia não esta funcionando para o conveter corrija, ou use uma classe controlada com @ApplicationScop para te retornar a instancia correta do service controlar pelo spring ou a instancia do EntityManaget

entao alexafe eu percebi essa “cagadinha” hehe, entao rodrigo.uchoaquanto ao erro:

at br.ucdb.model.pesistencia.dao.impl.GenericJPADAO.buscarPorId(GenericJPADAO.java:56)    

ja verifiquei e vi qeu o getDAO() ta vindo nulo mesmo, ja refiz todas as minhas classes hahaha pra ver se tinha faltado algo, mas ta na mesma, depois eu vo ver isso melhor(nao estou desistindo !), valews pelas respostas alexafe e rodrigo.uchoa

Todo os objetos dentro do service vao estar null se a injecao estiver errada

Resolvi o problema, não havia nada de errado com as injeçoes, o erro estava no jsf:

{usuarioController.salvar}

estava sem o # , falta de atenção só gera dor de cabeça mesmo.

Obrigado a todos que pararam para ler e tentaram me ajudar !

THANKS ! ^^