Classe Com Problema
package financeiro.web.filter;
import financeiro.util.HibernateUtil;
import javax.servlet.*;
import org.hibernate.SessionFactory;
public class ConexaoHibernateFilter implements Filter { <-- nao consegue achar o Filter em import.javax.servlet.*;
private SessionFactory sf;
public void init(FilterConfig config) throws ServletException { <-- o ServletException tambem nao é encontrado ele fica sublinhado de vermelho no eclipse
this.sf = HibernateUtil.getSessionFactory();
}
public void doFilter(ServletRequest servletRequest, <-- O ServletRequest e o Response, tambem nao sao encontrados ele fica sublinhado de vermelho no eclipse
ServletResponse servletResponse, FilterChain chain) <-- nem o Filter Chain
throws ServletException {
try {
this.sf.getCurrentSession().beginTransaction();
chain.doFilter(servletRequest, servletResponse);
this.sf.getCurrentSession().getTransaction().commit();
this.sf.getCurrentSession().close();
} catch (Throwable e) {
try {
if (this.sf.getCurrentSession().getTransaction().isActive()) {
this.sf.getCurrentSession().getTransaction().rollback();
}
} catch (Throwable ex) {
ex.printStackTrace();
}
throw new ServletException(e);
}
}
public void destroy() {
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="c3po.min_size">5</property>
<property name="c3po.max_size">20</property>
<property name="c3po.timeout">300</property>
<property name="c3po.max_statements">50</property>
<property name="c3po.idle_test_period">3000</property>
<!-- Configurações de Debug -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="generate_statistics">true</property>
<property name="use_sql_comments">true</property>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost:3306/financeiro</property>
<property name="connection.username">root</property>
<property name="connection.password">root</property>
<property name="current_session_context_class">thread</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping class="financeiro.usuario.Usuario"/>
</session-factory>
</hibernate-configuration>
Esse é o Web.xml
Classe HibernateUtil.java
package financeiro.util;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
public class HibernateUtil {
private static final SessionFactory sessionFactory = buildSessionFactory();
private static SessionFactory buildSessionFactory() {
try {
AnnotationConfiguration cfg = new AnnotationConfiguration();
cfg.configure("hibernate.cfg.xml");
return cfg.buildSessionFactory();
} catch (Throwable e) {
System.out
.println("Criação Inicial do Objeto SessionFactory Falhou. Erro: "
+ e);
throw new ExceptionInInitializerError(e);
}
}
public static SessionFactory getSessionFactory() {
return sessionFactory;
}
}
E os Jars do projeto
antlr-2.7.6.jar
commons-beanutils-1.8.3.jar
commons-colections-3.1.jar
commons-colections-3.2.1.jar
commons-digester3-3.2.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
hibernate3.jar
hibernate-jpa-2.0-api-1.0.0.final.jar
javassist-3.9.0.GA.jar
jsf-api.jar
jsf-impl.jar
jstl-1.2.jar
jta-1.1.jar
mysql-connector-java-5.1.7-bin.jar
slf4j-api-1.7.2.jar
slf4j-simple-1.7.2.jar
Bom Pessoal nao sei mais o que fazer adicioneis todos os jars, mas mesmo assim continua nao funcionando...