E ai galera, tipo to seguindo aqui um livro da Novatec e quando vou coloco o sistema pra rodar ele me retorna um NullPointerException no método doFilter na classe ConexaoHibernateFilter. Segue o código do método:
public void doFilter(ServletRequest servletRequest,
ServletResponse servletResponse, FilterChain chain)
throws ServletException {
try {
this.sf.getCurrentSession().beginTransaction();
chain.doFilter(servletRequest, servletResponse);
this.sf.getCurrentSession().getTransaction().commit();
this.sf.getCurrentSession().close();
} catch (Throwable ex) {
try {
if (this.sf.getCurrentSession().getTransaction().isActive()) {
this.sf.getCurrentSession().getTransaction().rollback();
}
} catch (Throwable t) {
t.printStackTrace();
}
throw new ServletException(ex);
}
}
O que pode estar retornando esse erro? Sou iniciante com web.