Solucionado (ver solução)
Solucionado
(ver solução)
13
respostas

Erro ao clicar em usuarios (PersistenceException)

Ao clicar em Usuarios

javax.servlet.ServletException: javax.persistence.PersistenceException: Unable to build entity manager factory
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:122)
13 respostas

Oi Thiago, tudo bem?

Como você colocou apenas uma parte da exception, não consegui decifrar qual problema está acontecendo. Tem como colocar a pilha inteira? Pode ser problema de conexão com o banco, nome da persistence-unit errada, persistence.xml no lugar errado etc...

type Exception report

message java.lang.ExceptionInInitializerError

description The server encountered an internal error that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: java.lang.ExceptionInInitializerError
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:122)
root cause

java.lang.ExceptionInInitializerError
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110)
    org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:84)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
    org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
    org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85)
    org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183)
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:733)
    org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
    org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
    org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    org.jboss.weld.proxies.EntityManager$980463800$Proxy$_$$_WeldClientProxy.createQuery(Unknown Source)
    br.com.alura.horas.dao.UsuarioDao.lista(UsuarioDao.java:31)
    br.com.alura.horas.dao.UsuarioDao$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    br.com.alura.horas.controllers.UsuarioController.lista(UsuarioController.java:44)
    br.com.alura.horas.controllers.UsuarioController$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
    net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
    br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78)
    br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98)
    br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93)
    br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$_$$_WeldClientProxy.start(Unknown Source)
    br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:93)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:118)
root cause

javax.persistence.PersistenceException: Unable to build entity manager factory
    org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83)
    org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
    br.com.alura.horas.infra.EntityManagerProducer.<clinit>(EntityManagerProducer.java:14)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110)
    org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:84)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
    org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
    org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85)
    org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183)
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:733)
    org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
    org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
    org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    org.jboss.weld.proxies.EntityManager$980463800$Proxy$_$$_WeldClientProxy.createQuery(Unknown Source)
    br.com.alura.horas.dao.UsuarioDao.lista(UsuarioDao.java:31)
    br.com.alura.horas.dao.UsuarioDao$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    br.com.alura.horas.controllers.UsuarioController.lista(UsuarioController.java:44)
    br.com.alura.horas.controllers.UsuarioController$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
    net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
    br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78)
    br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98)
    br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93)
    br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$_$$_WeldClientProxy.start(Unknown Source)
    br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:93)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:118)
root cause

org.hibernate.exception.JDBCConnectionException: Error calling Driver#connect
    org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator$1$1.convert(BasicConnectionCreator.java:122)
    org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.convertSqlException(BasicConnectionCreator.java:140)
    org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:58)
    org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.createConnection(BasicConnectionCreator.java:75)
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:106)
    org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
    org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
    org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
    org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
    org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75)
    org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
    br.com.alura.horas.infra.EntityManagerProducer.<clinit>(EntityManagerProducer.java:14)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110)
    org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:84)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
    org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
    org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85)
    org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183)
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:733)
    org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
    org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
    org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    org.jboss.weld.proxies.EntityManager$980463800$Proxy$_$$_WeldClientProxy.createQuery(Unknown Source)
    br.com.alura.horas.dao.UsuarioDao.lista(UsuarioDao.java:31)
    br.com.alura.horas.dao.UsuarioDao$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    br.com.alura.horas.controllers.UsuarioController.lista(UsuarioController.java:44)
    br.com.alura.horas.controllers.UsuarioController$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
    net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
    br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78)
    br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98)
    br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93)
    br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$_$$_WeldClientProxy.start(Unknown Source)
    br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:93)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:118)
root cause

java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
    com.mysql.jdbc.SQLError.createSQLException(SQLError.java:963)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3966)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3902)
    com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:875)
    com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1712)
    com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1228)
    com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253)
    com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
    com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
    com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
    com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
    com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410)
    com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328)
    org.hibernate.engine.jdbc.connections.internal.DriverConnectionCreator.makeConnection(DriverConnectionCreator.java:55)
    org.hibernate.engine.jdbc.connections.internal.BasicConnectionCreator.createConnection(BasicConnectionCreator.java:75)
    org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl.configure(DriverManagerConnectionProviderImpl.java:106)
    org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
    org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
    org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
    org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
    org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:398)
    org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75)
    org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
    br.com.alura.horas.infra.EntityManagerProducer.<clinit>(EntityManagerProducer.java:14)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110)
    org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:84)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
    org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
    org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85)
    org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183)
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:733)
    org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
    org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
    org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    org.jboss.weld.proxies.EntityManager$980463800$Proxy$_$$_WeldClientProxy.createQuery(Unknown Source)
    br.com.alura.horas.dao.UsuarioDao.lista(UsuarioDao.java:31)
    br.com.alura.horas.dao.UsuarioDao$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    br.com.alura.horas.controllers.UsuarioController.lista(UsuarioController.java:44)
    br.com.alura.horas.controllers.UsuarioController$Proxy$_$$_WeldClientProxy.lista(Unknown Source)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    net.vidageek.mirror.provider.java.PureJavaMethodReflectionProvider.invoke(PureJavaMethodReflectionProvider.java:38)
    net.vidageek.mirror.invoke.MethodHandlerByMethod.withArgs(MethodHandlerByMethod.java:54)
    br.com.caelum.vraptor.observer.ExecuteMethod.execute(ExecuteMethod.java:87)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:78)
    br.com.caelum.vraptor.interceptor.FlashInterceptor.intercept(FlashInterceptor.java:98)
    br.com.caelum.vraptor.interceptor.FlashInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor.intercept(ExceptionHandlerInterceptor.java:75)
    br.com.caelum.vraptor.interceptor.ExceptionHandlerInterceptor$Proxy$_$$_WeldClientProxy.intercept(Unknown Source)
    br.com.caelum.vraptor.core.ToInstantiateInterceptorHandler.execute(ToInstantiateInterceptorHandler.java:58)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.next(DefaultInterceptorStack.java:83)
    br.com.caelum.vraptor.core.DefaultInterceptorStack.start(DefaultInterceptorStack.java:93)
    br.com.caelum.vraptor.core.DefaultInterceptorStack$Proxy$_$$_WeldClientProxy.start(Unknown Source)
    br.com.caelum.vraptor.observer.RequestHandlerObserver.handle(RequestHandlerObserver.java:93)
    sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    java.lang.reflect.Method.invoke(Unknown Source)
    org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:266)
    org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
    org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:232)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:169)
    org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:165)
    org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:119)
    org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:112)
    org.jboss.weld.event.EventImpl.fire(EventImpl.java:83)
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:118)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.77 logs.
Access denied for user 'root'@'localhost' (using password: YES)

Parece que você passou uma senha errada na hora de conectar.

Eu tenho certeza que passei a senha certa.

Eu acho que não está encontrando o banco de dados, pois alterei o nome do banco por outro nome qualquer no persistence e deu o mesmo erro.

Opa, quando você falou que mudou o nome do banco, é nome da base? Porque se for isso a senha para acessar continua a mesma. O meu palpite continua sendo senha ou usuário errado.

Ao abri o MySQL 5.6 Command Line Client, coloque a senha "1234". Entrou, listei os databases, o "horas" estava lá.

Meu arquivo persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
    version="2.0">
    <persistence-unit name="default">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>

        <properties>
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/horasa" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="1234" />
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="hibernate.show_sql" value="true"/>
            <property name="hibernate.format_sql" value="true"/>
        </properties>
    </persistence-unit>
</persistence>

Está dando um erro na minha EntityManager, mas não sei onde.

EntityManagerProducer.class

package br.com.alura.horas.infra;

import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Disposes;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

@ApplicationScoped
public class EntityManagerProducer{
    private EntityManagerFactory factory = Persistence.createEntityManagerFactory("default");

    @Produces @RequestScoped   
    public EntityManager getEntityManager() {
        return factory.createEntityManager();
    }

    public void close(@Disposes EntityManager manager){
        manager.close();
    }
}

Um pedaço do erro gerado:

exception

javax.servlet.ServletException: javax.persistence.PersistenceException: Unable to build entity manager factory
    br.com.caelum.vraptor.VRaptor.doFilter(VRaptor.java:122)
root cause

javax.persistence.PersistenceException: Unable to build entity manager factory
    org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83)
    org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
    br.com.alura.horas.infra.EntityManagerProducer.<init>(EntityManagerProducer.java:13)
    sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    java.lang.reflect.Constructor.newInstance(Unknown Source)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:110)
    org.jboss.weld.injection.ConstructorInjectionPoint.invokeAroundConstructCallbacks(ConstructorInjectionPoint.java:84)
    org.jboss.weld.injection.ConstructorInjectionPoint.newInstance(ConstructorInjectionPoint.java:71)
    org.jboss.weld.injection.producer.AbstractInstantiator.newInstance(AbstractInstantiator.java:28)
    org.jboss.weld.injection.producer.BasicInjectionTarget.produce(BasicInjectionTarget.java:85)
    org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:183)
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:149)
    org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:733)
    org.jboss.weld.injection.producer.AbstractMemberProducer.getReceiver(AbstractMemberProducer.java:128)
    org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:148)
    org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)

Alguem ajuda???

Opa, agora que eu vi outra coisa. Apaga a linha <provider>org.hibernate.ejb.HibernatePersistence</provider>

Ressaltando, que se a reclamação de senha continuar, tem que continuar investigando isso... Escreve de novo a linha de configuração e tal...

Não funcionou, deu o mesmo erro.

Oi Thiago, não sei mais onde pode ser.. minha última opção é que você compartilhe o projeto num github.. posso baixar e testar aqui...

Duas Questões sobre isso

1 o nome da sua base de dados é horasa ? 2 ja verificou se o datasources foi criado corretamente no seu web server ?

O nome do banco é horas, eu apenas troquei para "horasa" para verificar se estava reconhecendo o banco, mas ao fazer isso o erro permaneceu o mesmo.

https://github.com/thiagoximenes/projjpa.git

solução!

Enfim, achei os erros e os concertei.

Obrigado quem tentou ajudar!