Implementando Classe Dao

Ocorreu esse erro:

jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version name: Apache Tomcat/9.0.14
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server built: Dec 6 2018 21:13:53 UTC
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Server version number: 9.0.14.0
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Name: Windows 10
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: OS Version: 10.0
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Architecture: amd64
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Java Home: C:\Program Files\Java\jre1.8.0_191
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Version: 1.8.0_191-b12
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: JVM Vendor: Oracle Corporation
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_BASE: C:\Program Files\apache-tomcat-9.0.14
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: CATALINA_HOME: C:\Program Files\apache-tomcat-9.0.14
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.base=C:\Program Files\apache-tomcat-9.0.14
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dcatalina.home=C:\Program Files\apache-tomcat-9.0.14
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dwtp.deploy=C:\Program Files\apache-tomcat-9.0.14\wtpwebapps
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Djava.endorsed.dirs=C:\Program Files\apache-tomcat-9.0.14\endorsed-Xmx256m
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Xmx512m
jan 15, 2019 9:35:46 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMAÇÕES: Command line argument: -Dfile.encoding=Cp1252
jan 15, 2019 9:35:46 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: Loaded APR based Apache Tomcat Native library [1.2.19] using APR version [1.6.5].
jan 15, 2019 9:35:46 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
jan 15, 2019 9:35:46 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMAÇÕES: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
jan 15, 2019 9:35:46 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFORMAÇÕES: OpenSSL successfully initialized [OpenSSL 1.1.1a 20 Nov 2018]
jan 15, 2019 9:35:47 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler [“http-nio-8080”]
jan 15, 2019 9:35:47 PM org.apache.coyote.AbstractProtocol init
INFORMAÇÕES: Initializing ProtocolHandler [“ajp-nio-8009”]
jan 15, 2019 9:35:47 PM org.apache.catalina.startup.Catalina load
INFORMAÇÕES: Server initialization in [1.826] milliseconds
jan 15, 2019 9:35:47 PM org.apache.catalina.core.StandardService startInternal
INFORMAÇÕES: Starting service [Catalina]
jan 15, 2019 9:35:47 PM org.apache.catalina.core.StandardEngine startInternal
INFORMAÇÕES: Starting Servlet engine: [Apache Tomcat/9.0.14]
jan 15, 2019 9:35:50 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:50 PM com.sun.faces.config.ConfigureListener contextInitialized
INFORMAÇÕES: Inicializando Mojarra 2.2.14 ( 20161114-2153 unable to get svn info) para o contexto '/meuPrimeiroProjetoJsf’
jan 15, 2019 9:35:50 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 15, 2019 9:35:52 PM org.apache.catalina.session.StandardSession doReadObject
ADVERTÊNCIA: Cannot deserialize session attribute [com.sun.faces.application.view.activeViewMaps] for session [AF471EEF6BCEAB69150D5AE16E3989F1]
jan 15, 2019 9:35:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Diretório de instalação da aplicação web [C:\Program Files\apache-tomcat-9.0.14\webapps\docs]
jan 15, 2019 9:35:52 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.14\webapps\docs] has finished in [234] ms
jan 15, 2019 9:35:52 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Diretório de instalação da aplicação web [C:\Program Files\apache-tomcat-9.0.14\webapps\examples]
jan 15, 2019 9:35:53 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:53 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: ContextListener: contextInitialized()
jan 15, 2019 9:35:53 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: SessionListener: contextInitialized()
jan 15, 2019 9:35:53 PM org.apache.catalina.core.ApplicationContext log
INFORMAÇÕES: ContextListener: attributeAdded(‘StockTicker’, ‘async.Stockticker@1f2f0109’)
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.14\webapps\examples] has finished in [835] ms
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Diretório de instalação da aplicação web [C:\Program Files\apache-tomcat-9.0.14\webapps\host-manager]
jan 15, 2019 9:35:53 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.14\webapps\host-manager] has finished in [346] ms
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Diretório de instalação da aplicação web [C:\Program Files\apache-tomcat-9.0.14\webapps\manager]
jan 15, 2019 9:35:53 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.14\webapps\manager] has finished in [301] ms
jan 15, 2019 9:35:53 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Diretório de instalação da aplicação web [C:\Program Files\apache-tomcat-9.0.14\webapps\ROOT]
jan 15, 2019 9:35:54 PM org.apache.jasper.servlet.TldScanner scanJars
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.
jan 15, 2019 9:35:54 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deployment of web application directory [C:\Program Files\apache-tomcat-9.0.14\webapps\ROOT] has finished in [430] ms
jan 15, 2019 9:35:54 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler [“http-nio-8080”]
jan 15, 2019 9:35:54 PM org.apache.coyote.AbstractProtocol start
INFORMAÇÕES: Starting ProtocolHandler [“ajp-nio-8009”]
jan 15, 2019 9:35:54 PM org.apache.catalina.startup.Catalina start
INFORMAÇÕES: Server startup in [6.545] milliseconds
jan 15, 2019 9:36:07 PM com.sun.faces.application.view.ViewScopeManager
INFORMAÇÕES: CDI @ViewScoped bean functionality unavailable
jan 15, 2019 9:36:17 PM com.sun.faces.lifecycle.InvokeApplicationPhase execute
ADVERTÊNCIA: #{pessoaBean.salvar}: java.lang.ExceptionInInitializerError
javax.faces.FacesException: #{pessoaBean.salvar}: 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)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)
Caused by: javax.faces.el.EvaluationException: java.lang.ExceptionInInitializerError
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
… 29 more
Caused by: java.lang.ExceptionInInitializerError
at br.com.dao.DaoGeneric.salvar(DaoGeneric.java:11)
at br.com.cursojsf.PessoaBean.salvar(PessoaBean.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
… 30 more
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named meuprimeiroprojetojsf
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at br.com.jpaUtil.JpaUtil.(JpaUtil.java:13)
… 40 more

jan 15, 2019 9:36:17 PM org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/meuPrimeiroProjetoJsf] threw exception [java.lang.ExceptionInInitializerError] with root cause
javax.persistence.PersistenceException: No Persistence provider for EntityManager named meuprimeiroprojetojsf
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at br.com.jpaUtil.JpaUtil.(JpaUtil.java:13)
at br.com.dao.DaoGeneric.salvar(DaoGeneric.java:11)
at br.com.cursojsf.PessoaBean.salvar(PessoaBean.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.el.parser.AstValue.invoke(AstValue.java:247)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:267)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
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)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

Boa tarde, Busque nesse log pela palavra “ADVERTÊNCIA” que irá identificar de forma mais clara onde esta o problema. Segue o uqe pude identificar:

ADVERTÊNCIA: Cannot deserialize session attribute [com.sun.faces.application.view.activeViewMaps] for session [AF471EEF6BCEAB69150D5AE16E3989F1]

ADVERTÊNCIA: #{pessoaBean.salvar}: java.lang.ExceptionInInitializerError
javax.faces.FacesException: #{pessoaBean.salvar}: java.lang.ExceptionInInitializerError
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)

Para inicio de conversa daria uma olhada no seu codigo nesse dois ponto para poder achar o problema.

Abraços
Max

Tentei ler o post mas não entendi sua dúvida.

Acho que ele tentou implementar a classe Dao e deu erro logo de cara. Pelo menos foi isso que entendi.

Ele bem que poderia ter colocado o enunciado do problema que ele estava tendo né … ae fica mais fácil saber como ajudar.

Exatamente, tentei fazer a DAO e deu erro. Obrigado pela dica!

Mailson_Fernando, bom dia,
posta o código que você fez para que possamos juntos solucionar
Abraços
Max

Posta o código do método salvar, da classe DaoGeneric.