Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

Problema na classe Autorizador

Depois que eu escrevi o código passado na aula, eu fui testa-lo, mas me deparei com esse erro:

INFORMAÇÕES: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
...
 Source Document: jndi:/localhost/livraria/WEB-INF/faces-config.xml
  Cause: Unable to create a new instance of 'br.com.caelum.livraria.util.Autorizador': javax.faces.FacesException: br.com.caelum.livraria.util.Autorizador
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:378)
    at com.sun.faces.config.processor.LifecycleConfigProcessor.addPhaseListeners(LifecycleConfigProcessor.java:154)
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:132)
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:152)
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:239)
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:439)
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5195)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5720)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: javax.faces.FacesException: br.com.caelum.livraria.util.Autorizador
    at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:428)
    at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:301)
    ...
Caused by: java.lang.ClassNotFoundException: br.com.caelum.livraria.util.Autorizador
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1955)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1798)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at com.sun.faces.util.Util.loadClass(Util.java:364)
    at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:420)
...
GRAVE: O aplicativo não foi iniciado corretamente na inicialização. Não foi possível encontrar Fábrica: javax.faces.application.ApplicationFactory. Attempting to find backup.
jan 28, 2020 12:58:59 PM com.sun.faces.config.ConfigureListener contextDestroyed
GRAVE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:555)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:283)
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:140)
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:343)
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5242)
    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5933)
    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:221)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:149)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1707)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1697)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
...


Meu projeto -> https://drive.google.com/file/d/1XWZFQ9aSsw6zHbJ2IPb9qGCLncZlA5aR/view?usp=sharing
1 resposta
solução!
Eu já estava com um outro problema além desse, só que no banco de dados,
e decidi excluir e refazer o projeto, pra minha surpresa funcionou.