javax.persistence.PersistenceException: Unable to build entity manager factory

Hibernate JIRA | Anthony Ogier | 3 years ago
  1. 0

    [HHH-9144] NameNotFoundException when creating EntityManager using CDI - Hibernate JIRA

    atlassian.net | 1 year ago
    javax.persistence.PersistenceException: Unable to build entity manager factory
  2. 0

    I'm using CDI to build my EntityManager. When building it, Hibernate doesn't manage to retrieve my DataSource using JNDI. It's not a problem of my {{persistence.xml}} or {{context.xml}} because when my EntityManager is built sooner (in a {{@WebListener > .contextInitialized(ServletContextEvent)}}), the DataSource is correctly found using the same JNDI address. I debugged the application and saw that {{new javax.naming.InitialContext().lookup("java:/comp/env/jdbc/myproject")}} was correctly returning the DataSource until {{Thread.currentThread().setContextClassLoader( aggregatedClassLoader )}} in : {code:java|title=org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.java} public <T> T withTccl(Work<T> work) { final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); boolean set = false; try { Thread.currentThread().setContextClassLoader( aggregatedClassLoader ); set = true; } catch (Exception ignore) { } try { return work.perform(); } finally { if ( set ) { Thread.currentThread().setContextClassLoader( tccl ); } } } {code} After the execution of that line, {{new javax.naming.InitialContext().lookup("java:/comp/env/jdbc/myproject")}} throws {{javax.naming.NameNotFoundException: Name java:/comp/env/jdbc/myproject is not bound in this Context}}. Here is the complete stack : {noformat} javax.persistence.PersistenceException: Unable to build entity manager factory at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManagerFactory(EntityManagerFactoryProducer.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) at org.jboss.weld.proxies.EntityManagerFactory$1746355237$Proxy$_$$_WeldClientProxy.createEntityManager(Unknown Source) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManager(EntityManagerFactoryProducer.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) at org.jboss.weld.proxies.EntityManager$1746355238$Proxy$_$$_WeldClientProxy.getTransaction(Unknown Source) at com.mycompany.myframework.transaction.TransactionalInterceptor.interceptTransactional(TransactionalInterceptor.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:116) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:94) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:36) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:51) at com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldSubclass.findAll(Unknown Source) at com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldClientProxy.findAll(Unknown Source) at com.mycompany.myproject.ws.administration.UserSearchWS.init(UserSearchWS.java:56) at com.mycompany.myproject.ws.administration.UserSearchWS$Proxy$_$$_WeldClientProxy.init(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:288) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:242) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [java:/comp/env/jdbc/myproject] at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:117) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) ... 79 more Caused by: javax.naming.NameNotFoundException: Name java:/comp/env/jdbc/myproject is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:820) at org.apache.naming.NamingContext.lookup(NamingContext.java:154) at javax.naming.InitialContext.lookup(InitialContext.java:415) at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114) ... 95 more {noformat} Here are the classes : {code:java|title=com.mycompany.myproject.ws.administration.UserSearchWS.java} @Path("/administration/userSearch") @ApplicationScoped public class UserSearchWS { @Inject private ProfileService profileService; @GET @Path("/init") public StreamingOutput init() { final List<Profile> profileList = profileService.findAll(); ... {code} {code:java|title=com.mycompany.myproject.service.ProfileService.java} @Transactional @ApplicationScoped public class ProfileService extends JPAEntityService<Profile, Integer> { @Inject private Instance<EntityManager> entityManagerInstance; public List<Profile> findAll() { return entityManagerInstance.get().createQuery("from Profile").getResultList(); } } {code} {code:java|title=com.mycompany.myframework.transaction.TransactionalInterceptor.java} @Interceptor @Transactional public class TransactionalInterceptor { @Inject Instance<EntityManager> entityManagerInstance; @AroundInvoke public Object interceptTransactional(final InvocationContext invocationContext) throws Exception { EntityManager entityManager = null; EntityTransaction transaction = null; try { entityManager = entityManagerInstance.get(); transaction = entityManager.getTransaction(); } catch (final ContextException e) { ... {code} {code:java|title=com.mycompany.myproject.data.EntityManagerFactoryProducer.java} @ApplicationScoped public class EntityManagerFactoryProducer { @Produces @ApplicationScoped public EntityManagerFactory createEntityManagerFactory() { return Persistence.createEntityManagerFactory("com.mycompany.myproject"); } @Produces @RequestScoped public EntityManager createEntityManager(final EntityManagerFactory entityManagerFactory) { return entityManagerFactory.createEntityManager(); } ... // @Disposes code {code} {code:xml|title=persistence.xml} ... <persistence-unit name="com.mycompany.myproject" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <non-jta-data-source>java:/comp/env/jdbc/myproject</non-jta-data-source> ... {code} And when I use that {{DataInitializer}}, I'm getting no problem, the previous code passes because the {{EntityManagerFactory}} is correctly initialized : {code:java|title=com.mycompany.myproject.bootstrap.DataInitializer.java} @WebListener public class DataInitializer implements ServletContextListener { @Override public void contextInitialized(final ServletContextEvent sce) { try { final Context ctx = new InitialContext(); final BeanManager beanManager = (BeanManager) ctx.lookup("java:comp/env/BeanManager"); final Bean<EntityManagerFactory> bean = (Bean<EntityManagerFactory>) beanManager.resolve(beanManager.getBeans(EntityManagerFactory.class)); final EntityManagerFactory entityManagerFactory = beanManager.getContext(bean.getScope()).get(bean, beanManager.createCreationalContext(bean)); final EntityManager entityManager = entityManagerFactory.createEntityManager(); } catch (final NamingException e) { throw new IllegalStateException("Problem while initializing", e); } } ... {code} In that case, here is the stack when correctly creating my {{EntityManagerFactory}} & {{EntityManager}} : {noformat} at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManagerFactory(EntityManagerFactoryProducer.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at com.mycompany.myproject.bootstrap.DataInitializer.createSampleDatas(DataInitializer.java:29) at com.mycompany.myproject.bootstrap.DataInitializer.contextInitialized(DataInitializer.java:66) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) {noformat} I've tested with latest Tomcat (7.0.53) and still have the same behaviors.

    Hibernate JIRA | 3 years ago | Anthony Ogier
    javax.persistence.PersistenceException: Unable to build entity manager factory
  3. 0

    I'm using CDI to build my EntityManager. When building it, Hibernate doesn't manage to retrieve my DataSource using JNDI. It's not a problem of my {{persistence.xml}} or {{context.xml}} because when my EntityManager is built sooner (in a {{@WebListener > .contextInitialized(ServletContextEvent)}}), the DataSource is correctly found using the same JNDI address. I debugged the application and saw that {{new javax.naming.InitialContext().lookup("java:/comp/env/jdbc/myproject")}} was correctly returning the DataSource until {{Thread.currentThread().setContextClassLoader( aggregatedClassLoader )}} in : {code:java|title=org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.java} public <T> T withTccl(Work<T> work) { final ClassLoader tccl = Thread.currentThread().getContextClassLoader(); boolean set = false; try { Thread.currentThread().setContextClassLoader( aggregatedClassLoader ); set = true; } catch (Exception ignore) { } try { return work.perform(); } finally { if ( set ) { Thread.currentThread().setContextClassLoader( tccl ); } } } {code} After the execution of that line, {{new javax.naming.InitialContext().lookup("java:/comp/env/jdbc/myproject")}} throws {{javax.naming.NameNotFoundException: Name java:/comp/env/jdbc/myproject is not bound in this Context}}. Here is the complete stack : {noformat} javax.persistence.PersistenceException: Unable to build entity manager factory at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:83) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManagerFactory(EntityManagerFactoryProducer.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) at org.jboss.weld.proxies.EntityManagerFactory$1746355237$Proxy$_$$_WeldClientProxy.createEntityManager(Unknown Source) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManager(EntityManagerFactoryProducer.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99) at org.jboss.weld.proxies.EntityManager$1746355238$Proxy$_$$_WeldClientProxy.getTransaction(Unknown Source) at com.mycompany.myframework.transaction.TransactionalInterceptor.interceptTransactional(TransactionalInterceptor.java:47) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:116) at org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:94) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43) at org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:36) at org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:51) at com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldSubclass.findAll(Unknown Source) at com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldClientProxy.findAll(Unknown Source) at com.mycompany.myproject.ws.administration.UserSearchWS.init(UserSearchWS.java:56) at com.mycompany.myproject.ws.administration.UserSearchWS$Proxy$_$$_WeldClientProxy.init(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:288) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:242) at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:728) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) Caused by: org.hibernate.engine.jndi.JndiException: Unable to lookup JNDI name [java:/comp/env/jdbc/myproject] at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:117) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) ... 79 more Caused by: javax.naming.NameNotFoundException: Name java:/comp/env/jdbc/myproject is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:820) at org.apache.naming.NamingContext.lookup(NamingContext.java:154) at javax.naming.InitialContext.lookup(InitialContext.java:415) at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114) ... 95 more {noformat} Here are the classes : {code:java|title=com.mycompany.myproject.ws.administration.UserSearchWS.java} @Path("/administration/userSearch") @ApplicationScoped public class UserSearchWS { @Inject private ProfileService profileService; @GET @Path("/init") public StreamingOutput init() { final List<Profile> profileList = profileService.findAll(); ... {code} {code:java|title=com.mycompany.myproject.service.ProfileService.java} @Transactional @ApplicationScoped public class ProfileService extends JPAEntityService<Profile, Integer> { @Inject private Instance<EntityManager> entityManagerInstance; public List<Profile> findAll() { return entityManagerInstance.get().createQuery("from Profile").getResultList(); } } {code} {code:java|title=com.mycompany.myframework.transaction.TransactionalInterceptor.java} @Interceptor @Transactional public class TransactionalInterceptor { @Inject Instance<EntityManager> entityManagerInstance; @AroundInvoke public Object interceptTransactional(final InvocationContext invocationContext) throws Exception { EntityManager entityManager = null; EntityTransaction transaction = null; try { entityManager = entityManagerInstance.get(); transaction = entityManager.getTransaction(); } catch (final ContextException e) { ... {code} {code:java|title=com.mycompany.myproject.data.EntityManagerFactoryProducer.java} @ApplicationScoped public class EntityManagerFactoryProducer { @Produces @ApplicationScoped public EntityManagerFactory createEntityManagerFactory() { return Persistence.createEntityManagerFactory("com.mycompany.myproject"); } @Produces @RequestScoped public EntityManager createEntityManager(final EntityManagerFactory entityManagerFactory) { return entityManagerFactory.createEntityManager(); } ... // @Disposes code {code} {code:xml|title=persistence.xml} ... <persistence-unit name="com.mycompany.myproject" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <non-jta-data-source>java:/comp/env/jdbc/myproject</non-jta-data-source> ... {code} And when I use that {{DataInitializer}}, I'm getting no problem, the previous code passes because the {{EntityManagerFactory}} is correctly initialized : {code:java|title=com.mycompany.myproject.bootstrap.DataInitializer.java} @WebListener public class DataInitializer implements ServletContextListener { @Override public void contextInitialized(final ServletContextEvent sce) { try { final Context ctx = new InitialContext(); final BeanManager beanManager = (BeanManager) ctx.lookup("java:comp/env/BeanManager"); final Bean<EntityManagerFactory> bean = (Bean<EntityManagerFactory>) beanManager.resolve(beanManager.getBeans(EntityManagerFactory.class)); final EntityManagerFactory entityManagerFactory = beanManager.getContext(bean.getScope()).get(bean, beanManager.createCreationalContext(bean)); final EntityManager entityManager = entityManagerFactory.createEntityManager(); } catch (final NamingException e) { throw new IllegalStateException("Problem while initializing", e); } } ... {code} In that case, here is the stack when correctly creating my {{EntityManagerFactory}} & {{EntityManager}} : {noformat} at org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114) at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206) at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) at org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75) at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55) at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39) at com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManagerFactory(EntityManagerFactoryProducer.java:16) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90) at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83) at org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96) at org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151) at org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96) at com.mycompany.myproject.bootstrap.DataInitializer.createSampleDatas(DataInitializer.java:29) at com.mycompany.myproject.bootstrap.DataInitializer.contextInitialized(DataInitializer.java:66) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744) {noformat} I've tested with latest Tomcat (7.0.53) and still have the same behaviors.

    Hibernate JIRA | 3 years ago | Anthony Ogier
    javax.persistence.PersistenceException: Unable to build entity manager factory
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Cannot call JNDI resource in persistence.xml file

    Stack Overflow | 3 years ago | artaxerxe
    javax.persistence.PersistenceException: Unable to build entity manager factory

  1. treefolk 1 times, last 2 weeks ago
  2. davidvanlaatum 1 times, last 4 months ago
7 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. javax.naming.NameNotFoundException

    Name java:/comp/env/jdbc/myproject is not bound in this Context

    at org.apache.naming.NamingContext.lookup()
  2. Web Container Naming Utilities
    NamingContext.lookup
    1. org.apache.naming.NamingContext.lookup(NamingContext.java:820)
    2. org.apache.naming.NamingContext.lookup(NamingContext.java:154)
    2 frames
  3. Java RT
    InitialContext.lookup
    1. javax.naming.InitialContext.lookup(InitialContext.java:415)
    1 frame
  4. org.hibernate.engine
    DatasourceConnectionProviderImpl.configure
    1. org.hibernate.engine.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:114)
    2. org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:115)
    2 frames
  5. org.hibernate.boot
    StandardServiceRegistryImpl.configureService
    1. org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    1 frame
  6. Hibernate
    JdbcServicesImpl.configure
    1. org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    2. org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    3. org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:260)
    4. org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:94)
    4 frames
  7. org.hibernate.boot
    StandardServiceRegistryImpl.configureService
    1. org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    1 frame
  8. Hibernate
    Configuration.buildSessionFactory
    1. org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    2. org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    3. org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1885)
    4. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1843)
    4 frames
  9. org.hibernate.jpa
    EntityManagerFactoryBuilderImpl$4.perform
    1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850)
    2. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843)
    2 frames
  10. org.hibernate.boot
    ClassLoaderServiceImpl.withTccl
    1. org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:397)
    1 frame
  11. org.hibernate.jpa
    HibernatePersistenceProvider.createEntityManagerFactory
    1. org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842)
    2. org.hibernate.jpa.HibernatePersistenceProvider.createEntityManagerFactory(HibernatePersistenceProvider.java:75)
    2 frames
  12. Hibernate EJB
    HibernatePersistence.createEntityManagerFactory
    1. org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:54)
    1 frame
  13. JavaEE 7
    Persistence.createEntityManagerFactory
    1. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:55)
    2. javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:39)
    2 frames
  14. com.mycompany.myproject
    EntityManagerFactoryProducer.createEntityManagerFactory
    1. com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManagerFactory(EntityManagerFactoryProducer.java:16)
    1 frame
  15. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  16. Weld Implementation
    ProxyMethodHandler.invoke
    1. org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)
    2. org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83)
    3. org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96)
    4. org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151)
    5. org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    6. org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    7. org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    8. org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    8 frames
  17. org.jboss.weld
    EntityManagerFactory$1746355237$Proxy$_$$_WeldClientProxy.createEntityManager
    1. org.jboss.weld.proxies.EntityManagerFactory$1746355237$Proxy$_$$_WeldClientProxy.createEntityManager(Unknown Source)
    1 frame
  18. com.mycompany.myproject
    EntityManagerFactoryProducer.createEntityManager
    1. com.mycompany.myproject.data.EntityManagerFactoryProducer.createEntityManager(EntityManagerFactoryProducer.java:27)
    1 frame
  19. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  20. Weld Implementation
    ProxyMethodHandler.invoke
    1. org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)
    2. org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstance(MethodInjectionPoint.java:83)
    3. org.jboss.weld.injection.producer.ProducerMethodProducer.produce(ProducerMethodProducer.java:96)
    4. org.jboss.weld.injection.producer.AbstractMemberProducer.produce(AbstractMemberProducer.java:151)
    5. org.jboss.weld.bean.AbstractProducerBean.create(AbstractProducerBean.java:183)
    6. org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
    7. org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
    8. org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:99)
    8 frames
  21. org.jboss.weld
    EntityManager$1746355238$Proxy$_$$_WeldClientProxy.getTransaction
    1. org.jboss.weld.proxies.EntityManager$1746355238$Proxy$_$$_WeldClientProxy.getTransaction(Unknown Source)
    1 frame
  22. com.mycompany.myframework
    TransactionalInterceptor.interceptTransactional
    1. com.mycompany.myframework.transaction.TransactionalInterceptor.interceptTransactional(TransactionalInterceptor.java:47)
    1 frame
  23. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  24. Weld Implementation
    SimpleInterceptorInvocation$SimpleMethodInvocation.invoke
    1. org.jboss.weld.interceptor.reader.SimpleInterceptorInvocation$SimpleMethodInvocation.invoke(SimpleInterceptorInvocation.java:74)
    1 frame
  25. org.jboss.weld
    AbstractInterceptionChain.invokeNextInterceptor
    1. org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNext(AbstractInterceptionChain.java:116)
    2. org.jboss.weld.interceptor.chain.AbstractInterceptionChain.invokeNextInterceptor(AbstractInterceptionChain.java:94)
    2 frames
  26. Weld Implementation
    CombinedInterceptorAndDecoratorStackMethodHandler.invoke
    1. org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.executeInterception(InterceptorMethodHandler.java:43)
    2. org.jboss.weld.interceptor.proxy.InterceptorMethodHandler.invoke(InterceptorMethodHandler.java:36)
    3. org.jboss.weld.bean.proxy.CombinedInterceptorAndDecoratorStackMethodHandler.invoke(CombinedInterceptorAndDecoratorStackMethodHandler.java:51)
    3 frames
  27. com.mycompany.myproject
    UserSearchWS$Proxy$_$$_WeldClientProxy.init
    1. com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldSubclass.findAll(Unknown Source)
    2. com.mycompany.myproject.service.ProfileService$Proxy$_$$_WeldClientProxy.findAll(Unknown Source)
    3. com.mycompany.myproject.ws.administration.UserSearchWS.init(UserSearchWS.java:56)
    4. com.mycompany.myproject.ws.administration.UserSearchWS$Proxy$_$$_WeldClientProxy.init(Unknown Source)
    4 frames
  28. Java RT
    Method.invoke
    1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    4. java.lang.reflect.Method.invoke(Method.java:606)
    4 frames
  29. RESTEasy JAX-RS Implementation
    HttpServletDispatcher.service
    1. org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)
    2. org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:288)
    3. org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:242)
    4. org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:229)
    5. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356)
    6. org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179)
    7. org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220)
    8. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    9. org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)
    9 frames
  30. JavaServlet
    HttpServlet.service
    1. javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    1 frame
  31. Glassfish Core
    ApplicationFilterChain.doFilter
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    2 frames
  32. Tomcat WS
    WsFilter.doFilter
    1. org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51)
    1 frame
  33. Glassfish Core
    CoyoteAdapter.service
    1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    3. org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    4. org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    5. org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    6. org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    7. org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
    8. org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
    9. org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    10. org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    10 frames
  34. Grizzly HTTP
    JIoEndpoint$SocketProcessor.run
    1. org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041)
    2. org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:603)
    3. org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    3 frames
  35. Java RT
    Thread.run
    1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    3. java.lang.Thread.run(Thread.java:744)
    3 frames