Ero Tom Cat ao tentar acessar página inicial

Olá pessoal,

Não consigo identificar a causa do erro ao tentar carregar a página inicial da aplicação.
O tom cat sobre mas ao tentar acessar a página inicial dá o seguinte erro:

Log do console:

Jan 27, 2013 6:53:18 PM org.apache.catalina.core.AprLifecycleListener init
Informações: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre7\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre7/bin/client;C:/Program Files/Java/jre7/bin;C:/Program Files/Java/jre7/lib/i386;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Windows Live\Shared;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\Java\jdk1.7.0_02\bin;C:\Ruby193\bin;C:\eclipse-jee-juno-win32\eclipse;;.
Jan 27, 2013 6:53:18 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
Advertência: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:FinanceiroWeb’ did not find a matching property.
Jan 27, 2013 6:53:19 PM org.apache.coyote.AbstractProtocol init
Informações: Initializing ProtocolHandler [“http-bio-8080”]
Jan 27, 2013 6:53:19 PM org.apache.coyote.AbstractProtocol init
Informações: Initializing ProtocolHandler [“ajp-bio-8009”]
Jan 27, 2013 6:53:19 PM org.apache.catalina.startup.Catalina load
Informações: Initialization processed in 880 ms
Jan 27, 2013 6:53:19 PM org.apache.catalina.core.StandardService startInternal
Informações: Starting service Catalina
Jan 27, 2013 6:53:19 PM org.apache.catalina.core.StandardEngine startInternal
Informações: Starting Servlet Engine: Apache Tomcat/7.0.27
Jan 27, 2013 6:53:22 PM org.apache.catalina.startup.TaglibUriRule body
Informações: TLD skipped. URI:
http://java.sun.com/jsf/html
is already defined
Jan 27, 2013 6:53:22 PM org.apache.catalina.startup.TaglibUriRule body
Informações: TLD skipped. URI: http://java.sun.com/jsf/core is already defined
Jan 27, 2013 6:53:22 PM org.apache.catalina.startup.TaglibUriRule body
Informações: TLD skipped. URI: http://mojarra.dev.java.net/mojarra_ext is already defined
Jan 27, 2013 6:53:22 PM com.sun.faces.config.ConfigureListener contextInitialized
Informações: Inicializando Mojarra 2.0.2 (FCS b10) para o contexto ‘/FinanceiroWeb’
Jan 27, 2013 6:53:23 PM com.sun.faces.spi.InjectionProviderFactory createInstance
Informações: JSF1048: Anotações PostConstruct/PreDestroy presentes. Os métodos ManagedBeans marcados com essas anotações informarão as anotações processadas.
Jan 27, 2013 6:53:23 PM com.sun.faces.config.ConfigureListener$WebConfigResourceMonitor$Monitor
Informações: Monitoring jndi:/localhost/FinanceiroWeb/WEB-INF/faces-config.xml for modifications
Jan 27, 2013 6:53:23 PM org.hibernate.annotations.common.Version
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
Jan 27, 2013 6:53:23 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.8.Final}
Jan 27, 2013 6:53:23 PM org.hibernate.cfg.Environment
INFO: HHH000206: hibernate.properties not found
Jan 27, 2013 6:53:23 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Jan 27, 2013 6:53:23 PM org.hibernate.cfg.Configuration configure
INFO: HHH000043: Configuring from resource: hibernate.cfg.xml
Jan 27, 2013 6:53:23 PM org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: HHH000040: Configuration resource: hibernate.cfg.xml
Jan 27, 2013 6:53:23 PM org.hibernate.internal.util.xml.DTDEntityResolver resolveEntity
WARN: HHH000223: Recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. Use namespace http://www.hibernate.org/dtd/ instead. Refer to Hibernate 3.6 Migration Guide!
Jan 27, 2013 6:53:24 PM org.hibernate.cfg.Configuration doConfigure
INFO: HHH000041: Configured SessionFactory: null
Jan 27, 2013 6:53:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
Jan 27, 2013 6:53:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
Jan 27, 2013 6:53:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: false
Jan 27, 2013 6:53:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://localhost:3306/financeiro]
Jan 27, 2013 6:53:24 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {user=root, password=****}
Jan 27, 2013 6:53:24 PM org.hibernate.dialect.Dialect
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLInnoDBDialect
Jan 27, 2013 6:53:25 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000399: Using default transaction strategy (direct JDBC transactions)
Jan 27, 2013 6:53:25 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory
INFO: HHH000397: Using ASTQueryTranslatorFactory
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000228: Running hbm2ddl schema update
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000102: Fetching database metadata
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000396: Updating schema
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
INFO: HHH000262: Table not found: Usuario
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.DatabaseMetadata getTableMetadata
INFO: HHH000262: Table not found: Usuario
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
ERROR: HHH000388: Unsuccessful: create table Usuario (codigo integer not null auto_increment, ativo boolean not null, celular varchar(255), email varchar(255), idioma varchar(255), login varchar(255), nascimento datetime, nome varchar(255), senha varchar(255), primary key (codigo), unique (login)) type=InnoDB
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
INFO: HHH000232: Schema update complete
Jan 27, 2013 6:53:25 PM org.apache.coyote.AbstractProtocol start
Informações: Starting ProtocolHandler [“http-bio-8080”]
Jan 27, 2013 6:53:25 PM org.apache.coyote.AbstractProtocol start
Informações: Starting ProtocolHandler [“ajp-bio-8009”]
Jan 27, 2013 6:53:25 PM org.apache.catalina.startup.Catalina start
Informações: Server startup in 6599 ms
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session;
at financeiro.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Jan 27, 2013 8:06:16 PM org.apache.catalina.core.StandardWrapperValve invoke
Grave: Servlet.service() for servlet [FacesServlet] in context with path [/FinanceiroWeb] threw exception [java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session;] with root cause
java.lang.NoSuchMethodError: org.hibernate.SessionFactory.getCurrentSession()Lorg/hibernate/classic/Session;
at financeiro.web.filter.ConexaoHibernateFilter.doFilter(ConexaoHibernateFilter.java:22)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Quem puder ajudar ficarei muito grato!

Tem um erro aqui:

[quote]ERROR: HHH000388: Unsuccessful: create table Usuario (codigo integer not null auto_increment, ativo boolean not null, celular varchar(255), email varchar(255), idioma varchar(255), login varchar(255), nascimento datetime, nome varchar(255), senha varchar(255), primary key (codigo), unique (login)) type=InnoDB
Jan 27, 2013 6:53:25 PM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘type=InnoDB’ at line 1 [/quote]

E outro aqui:

Nesse erro daqui parece que está faltando alguma biblioteca, porque ele diz que não existe o método getCurrentSession na classe SessionFactory que retorne um org.hibernate.classic.Session

Repare que há dois Session. Esse daí e o mais atual:

org.hibernate.classic.Session

É a mesma coisa que o de cima só que sem o “classic”.

Caro Arthur,

Consegui resolver o problema de cima, mas qual biblioteca estaria faltando?
Segue abaixo relação de lib’s:

antlr-2.7.7.jar
commons-beanutils-1.8.3.jar
commons-collections-3.2.1.jar
commons-digester3-3.2.jar
commons-logging-1.1.1.jar
dom4j-1.6.1.jar
hibernate-commons-annotations-4.0.1.Final.jar
hibernate-core-4.1.8.Final.jar
hibernate-jpa-2.0-api-1.0.1.Final.jar
javassist-3.15.0-GA.jar
javax.servlet.jsp.jstl-1.2.1.jar
javax.servlet.jsp.jstl-api-1.2.1.jar
jboss-logging-3.1.0.GA.jar
jboss-transaction-api_1.1_spec-1.0.0.Final.jar
jsf-api.jar
jsf-impl.jar
jstl.jar
mysql-connector-java-5.1.22-bin.jar
slf4j-api-1.6.0.jar
slf4j-simple-1.6.0.jar

Obrigado pela resposta!

Aguardando…

Não parece faltar nenhuma biblioteca. Por favor, vá na classe ConexaoHibernateFilter.java e cole aqui qual é o import que você está fazendo da Session.

Arthur,

Aqui está a classe:

package financeiro.web.filter;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.hibernate.SessionFactory;

import financeiro.util.HibernateUtil;

public class ConexaoHibernateFilter implements Filter{
private SessionFactory sf;
public void init(FilterConfig config) throws ServletException{
this.sf = HibernateUtil.getSessionFactory();
}

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);
}
}
public void destroy(){}
}

E então será que alguém pode analisar o código e me dizer algo a respeito porque não consigo fazer a página inicial carregar?

Caro Arthur, devo uma resposta a você já que foi o único a responder. O problema era a versão das lib’s do hibernate que a 4 tem seus bug’s e nçao funciona bem. Retirei as lib’s da versão 4 e substitui pela versão 3 e funcionou muito bem. Obrigado , pois foi a partir da sua dúvida das lib’s que parti para investigar mais obre elas.

Opa! O importante é que resolveu teu problema. Eu imaginava que poderia ter sido versão de pacote da Session, mas eu estava errado. Que bom que ficou tudo resolvido.