0 Replies Latest reply on May 19, 2016 5:56 PM by Ranga Thanikanti

    org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:jboss/resources/jdbc/twist]

    Ranga Thanikanti Newbie

      Hi,

       

      I am seeing below error in after deploying ear in JBos EAP 6.4 in domain (cluster) mode.

      This error is coming on slave servers

       

      Thu, 19 May 2016 15:21:59 CDT ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/Twist]] (ServerService Thread Pool -- 77) JBWEB000287: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: org.jboss.seam.InstantiationException: Could not instantiate Seam component: EMFactory

        at org.jboss.seam.Component.newInstance(Component.java:2144) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:116) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.init.Initialization.init(Initialization.java:740) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36) [jboss-seam.jar:2.2.0.GA]

        at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.5.15.Final-redhat-1.jar:7.5.15.Final-redhat-1]

        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3780) [jbossweb-7.5.15.Final-redhat-1.jar:7.5.15.Final-redhat-1]

        at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:163) [jboss-as-web-7.5.7.Final-redhat-3.jar:7.5.7.Final-redhat-3]

        at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:61) [jboss-as-web-7.5.7.Final-redhat-3.jar:7.5.7.Final-redhat-3]

        at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:96) [jboss-as-web-7.5.7.Final-redhat-3.jar:7.5.7.Final-redhat-3]

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_71]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_71]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_71]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_71]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_71]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122)

      Caused by: javax.persistence.PersistenceException: [PersistenceUnit: Twist] Unable to build EntityManagerFactory

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:925) [hibernate-entitymanager-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:900) [hibernate-entitymanager-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:59) [hibernate-entitymanager-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63) [hibernate-jpa-2.0-api-1.0.1.Final-redhat-3.jar:1.0.1.Final-redhat-3]

        at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47) [hibernate-jpa-2.0-api-1.0.1.Final-redhat-3.jar:1.0.1.Final-redhat-3]

        at org.jboss.seam.persistence.EntityManagerFactory.createEntityManagerFactory(EntityManagerFactory.java:81) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.persistence.EntityManagerFactory.startup(EntityManagerFactory.java:50) [jboss-seam.jar:2.2.0.GA]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_71]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_71]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_71]

        at java.lang.reflect.Method.invoke(Method.java:497) [rt.jar:1.8.0_71]

        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.Component.callComponentMethod(Component.java:2257) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.Component.callCreateMethod(Component.java:2172) [jboss-seam.jar:2.2.0.GA]

        at org.jboss.seam.Component.newInstance(Component.java:2132) [jboss-seam.jar:2.2.0.GA]

        ... 16 more

      Caused by: org.hibernate.service.jndi.JndiException: Unable to lookup JNDI name [java:jboss/resources/jdbc/twist]

        at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:68) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl.configure(DatasourceConnectionProviderImpl.java:116) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.buildJdbcConnectionAccess(JdbcServicesImpl.java:223) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:89) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:85) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:184) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:156) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1882) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:96) [hibernate-entitymanager-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:915) [hibernate-entitymanager-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        ... 31 more

      Caused by: javax.naming.NameNotFoundException: resources/jdbc/twist -- service jboss.naming.context.java.jboss.resources.jdbc.twist

        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:104)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:197)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)

        at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:245)

        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:174)

        at javax.naming.InitialContext.lookup(InitialContext.java:421) [rt.jar:1.8.0_71]

        at javax.naming.InitialContext.lookup(InitialContext.java:421) [rt.jar:1.8.0_71]

        at org.hibernate.service.jndi.internal.JndiServiceImpl.locate(JndiServiceImpl.java:65) [hibernate-core-4.2.22.Final-redhat-1.jar:4.2.22.Final-redhat-1]

        ... 44 more

       

      My configuration details are below

      web.xml

      -------------------------

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app id="WebApp_ID" version="2.5"

      xmlns="http://java.sun.com/xml/ns/javaee"

      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

      <!-- enable clustering in JBOSS -->

      <distributable/>

      <resource-ref>

        <res-ref-name>jdbc/twist</res-ref-name>

        <res-type>javax.sql.DataSource</res-type>

        <res-auth>Container</res-auth>

        <res-sharing-scope>Shareable</res-sharing-scope>

      </resource-ref>

      <resource-ref>

        <res-ref-name>jdbc/auth</res-ref-name>

        <res-type>javax.sql.DataSource</res-type>

        <res-auth>Container</res-auth>

        <res-sharing-scope>Shareable</res-sharing-scope>

      </resource-ref>

      </web-app>

       

      -------------------------------------------------------------------------------------------------------------------------------------------------------

       

      Jboss-web.xml

       

      <!DOCTYPE jboss-web PUBLIC

          "-//JBoss//DTD Web Application 4.2//EN"

          "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">

      <jboss-web>

          ....................................................

          ................................

          <replication-config>

              <replication-trigger>SET_AND_NON_PRIMITIVE_GET</replication-trigger>

              <replication-granularity>SESSION</replication-granularity>

           </replication-config>

           <resource-ref>

              <res-ref-name>jdbc/twist</res-ref-name>

              <res-type>javax.sql.DataSource</res-type>

              <jndi-name>java:jboss/resources/jdbc/twist</jndi-name>

          </resource-ref>

          <resource-ref>

              <res-ref-name>jdbc/auth</res-ref-name>

              <res-type>javax.sql.DataSource</res-type>

              <jndi-name>java:jboss/resources/jdbc/auth</jndi-name>

          </resource-ref>

      </jboss-web>

       

       

      help me to solve this issue.