1
resposta

Curso java e JSF 2 - II - Não roda com Tomcat 8

Prezados, acompanhei todo o curso java e JSF 2 - I, projeto Livraria, e tudo estava rodando normalmente. Ao mudar para o Tomcat 8, parou de funcionar. Alguém tem alguma solução?

INFORMAÇÕES: Server startup in 5096 ms
FASE: RESTORE_VIEW 1
/login.xhtml
FASE: RENDER_RESPONSE 6
abr 14, 2020 5:54:02 PM com.sun.faces.application.view.ViewScopeManager <init>
INFORMAÇÕES: CDI @ViewScoped bean functionality unavailable
FASE: RESTORE_VIEW 1
/login.xhtml
FASE: APPLY_REQUEST_VALUES 2
FASE: PROCESS_VALIDATIONS 3
FASE: UPDATE_MODEL_VALUES 4
FASE: INVOKE_APPLICATION 5
Fazendo login do usuário angelo@ceresa.adm.br
abr 14, 2020 5:54:17 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
abr 14, 2020 5:54:17 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.1.8.Final}
abr 14, 2020 5:54:17 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
abr 14, 2020 5:54:17 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
abr 14, 2020 5:54:19 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000402: Using Hibernate built-in connection pool (not for production use!)
abr 14, 2020 5:54:19 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000115: Hibernate connection pool size: 20
abr 14, 2020 5:54:19 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000006: Autocommit mode: true
abr 14, 2020 5:54:19 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000401: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql://livrariaceresa.mysql.uhserver.com:3306/livrariaceresa]
abr 14, 2020 5:54:19 PM org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure
INFO: HHH000046: Connection properties: {password=****, autocommit=true, release_mode=auto, user=alura}
abr 14, 2020 5:54:21 PM org.hibernate.dialect.Dialect <init>
INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
abr 14, 2020 5:54:21 PM org.hibernate.engine.transaction.internal.TransactionFactoryInitiator initiateService
INFO: HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jdbc.JdbcTransactionFactory
abr 14, 2020 5:54:21 PM org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory <init>
INFO: HHH000397: Using ASTQueryTranslatorFactory
abr 14, 2020 5:54:22 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
ADVERTÊNCIA: #{loginBean.efetuaLogin}: java.lang.ExceptionInInitializerError
javax.faces.FacesException: #{loginBean.efetuaLogin}: java.lang.ExceptionInInitializerError
    at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
    at javax.faces.component.UICommand.broadcast(UICommand.java:315)
    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
    at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
    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)
1 resposta

Oi Ângelo, tudo bem?

Verifica se você não está usando o Tomcat 8.5 ao invés do 8

Tenta subir o projeto da aula, veja se para o problema, link para download: https://s3.amazonaws.com/caelum-online-public/jsf-primefaces/stages/capitulo-2.zip

Se não der certo, mais para baixo nessa stack de erro que você enviou deve ter um Caused by, manda o log de erro todo, por favor