1 Reply Latest reply on Jan 24, 2017 2:11 AM by Martin Kouba

    RuntimeException: Error looking up java:comp/env/java:/ConnectionFactory in JNDI

    Bruce Springfield Apprentice

      Get a 'RuntimeException:Error looking up java:comp/env/java:/ConnectionFactory in JNDI' when run a test in TestNG that attempts to access the ConnectionFactory in a WebApp deployed on JBoss.

       

      The trace from TestNG has a lot of weld messages. Any ideas how to fix this problem?

       

      TestNG trace:

      java.lang.RuntimeException: Error looking up java:comp/env/java:/ConnectionFactory in JNDI at org.jboss.weld.injection.spi.helpers.AbstractResourceServices.resolveResource(AbstractResourceServices.java:51) at org.jboss.weld.util.Beans.injectEEFields(Beans.java:731) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:164) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:161) at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:135) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:157) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:297) at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:68) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:626) at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:692) at org.jboss.weld.injection.FieldInjectionPoint.inject(FieldInjectionPoint.java:136) at org.jboss.weld.util.Beans.injectBoundFields(Beans.java:796) at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:805) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1$1.proceed(ManagedBean.java:165) at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:48) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget$1.work(ManagedBean.java:161) at org.jboss.weld.bean.ManagedBean$FixInjectionPoint.run(ManagedBean.java:135) at org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.inject(ManagedBean.java:157) at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:297) at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:103) at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:90) at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:104)