Problema no exercício do curso: Java e JSF: Sua aplicação web com JSF2, aula: 9, exercício: 14 (www.alura.com.br/course/FJ-22/section/9/exercise/14)
Meu ambiente de desenvolvimento: Eclipse Java EE IDE for Web Developers, version Mars.1 v4.5.1 Oracle JDK 8u66 Maven v3.3.9 JBoss Tools v4.3.0.Final Servlet 3.0 JavaServer Faces v2.2.12 * MySQL v5.6.27, mysql java connector v5.1.38
Meu projeto no repositório do GitLab: https://gitlab.com/cviniciusm/jsf-livraria-alura
Coloquei como resolvido a questão anterior, mas em verdade continua errado, no contexto abaixo:
Esqueci de deixar claro na questão anteror que estou utilizando Primefaces 5.3 e Primefaces Themes 1.0.10 (primefaces-5.3.jar e all-themes-1.0.10.jar).
A aplicação abre normalmente (http://localhost/livraria/livro.xhtml ou http://localhost/livraria/autor.xhtml), no tema seleciona no TemaBean, e pode-se escolher os demais temais, com sucesso.
Mas no menu Cadastros, quando é selecionado a outra página para ser aberto, ou seja, abriu a aplicação na página de livro e no menu Cadastro escolheu autor, então o erro abaixo aparece.
Da mesma forma, se abriu a aplicação na página de autor, e depois selecionou a página de livro no menu Cadastros, então o erro abaixo aparece. ``` jan 15, 2016 8:15:48 AM com.sun.faces.application.view.FaceletViewHandlingStrategy handleRenderException GRAVE: Error Rendering View[/autor.xhtml] javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-" library at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:139) at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:76) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)
jan 15, 2016 8:15:48 AM org.apache.catalina.core.StandardWrapperValve invoke GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/livraria] threw exception [Error loading css, cannot find "theme.css" resource of "primefaces-" library] with root cause javax.faces.FacesException: Error loading css, cannot find "theme.css" resource of "primefaces-" library at org.primefaces.renderkit.HeadRenderer.encodeCSS(HeadRenderer.java:139) at org.primefaces.renderkit.HeadRenderer.encodeBegin(HeadRenderer.java:76) at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:865) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1854) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:458) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:134) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:521) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1096) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:674) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)