5 Replies Latest reply on Aug 23, 2007 2:03 AM by Alex Ka

    EntityManagerFactory not found in JNDI : java:/poctestEntity

    Ajeet Phansalkar Newbie

      Hi,
      I have generated a crud application using Seam 2.0 beta on jboss 4.2GA.This was done using seam generate-entitites adn then deployed.I have a single file mysql-ds.xml which has teh multiple datasources configured.The contents of teh data source file generated were copied to this file.When i try accessing the application it gives me an error

      EntityManagerFactory not found in JNDI : java:/poctestEntityManagerFactory

      I had earlier tried to generate teh CRUD application using the Hibernate tools from the JBoss IDE but that also gave errors on deploying.

      The following is teh stack trace
      17:02:42,507 INFO [Contexts] starting up: org.jboss.seam.security.identity
      17:02:42,507 INFO [Contexts] starting up: org.jboss.seam.web.session
      17:02:42,538 ERROR [STDERR] Aug 22, 2007 5:02:42 PM com.sun.facelets.FaceletView
      Handler handleRenderException
      SEVERE: Error Rendering View[/home.xhtml]
      java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : jav
      a:/poctestEntityManagerFactory
      at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager
      FactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:239)
      at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManage
      r(ManagedPersistenceContext.java:79)
      at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager
      (ManagedPersistenceContext.java:107)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
      at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
      at org.jboss.seam.Component.unwrap(Component.java:1983)
      at org.jboss.seam.Component.getInstance(Component.java:1770)
      at org.jboss.seam.Component.getInstance(Component.java:1723)
      at org.jboss.seam.Component.getInstance(Component.java:1717)
      at org.jboss.seam.framework.Controller.getComponentInstance(Controller.j
      ava:258)
      at org.jboss.seam.framework.PersistenceController.getPersistenceContext(
      PersistenceController.java:20)
      at org.jboss.seam.framework.EntityQuery.getEntityManager(EntityQuery.jav
      a:120)
      at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:29)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocation
      Context.java:31)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:56)
      at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackI
      nterceptor.java:31)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:68)
      at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionI
      nterceptor.java:38)
      at org.jboss.seam.util.Work.workInTransaction(Work.java:39)
      at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(Transa
      ctionInterceptor.java:32)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:68)
      at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodConte
      xtInterceptor.java:42)
      at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocation
      Context.java:68)
      at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:
      106)
      at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(Java
      BeanInterceptor.java:151)
      at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanIntercept
      or.java:87)
      at com.mydomain.poc.entity.HilosequencesList_$$_javassist_131.validate(H
      ilosequencesList_$$_javassist_131.java)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:124)
      at org.jboss.seam.Component.callComponentMethod(Component.java:1957)
      at org.jboss.seam.Component.callCreateMethod(Component.java:1880)
      at org.jboss.seam.Component.newInstance(Component.java:1859)
      at org.jboss.seam.Component.getInstance(Component.java:1756)
      at org.jboss.seam.Component.getInstance(Component.java:1723)
      at org.jboss.seam.Component.getInstance(Component.java:1717)
      at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:60)
      at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
      at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELRe
      solver.java:64)
      at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
      at org.jboss.el.parser.AstValue.getValue(AstValue.java:63)
      at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:18
      6)
      at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:112)
      at org.jboss.seam.navigation.Param.getValueFromModel(Param.java:127)
      at org.jboss.seam.navigation.Pages.getPageParameterValue(Pages.java:711)

      at org.jboss.seam.navigation.Pages.getConvertedParameters(Pages.java:687
      )
      at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBas
      e.java:50)
      at org.jboss.seam.ui.renderkit.LinkRendererBase.doEncodeBegin(LinkRender
      erBase.java:26)
      at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java
      :79)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.jav
      a:785)
      at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase
      .java:280)
      at org.richfaces.renderkit.html.ToolBarRendererBase.encodeChildren(ToolB
      arRendererBase.java:81)
      at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.
      java:809)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:892)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.jav
      a:577)
      at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapp
      er.java:108)
      at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandle
      r.java:233)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePha
      se.java:106)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:83)
      at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.jav
      a:63)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
      at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:87)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
      at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:63)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
      at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:46)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseX
      MLFilter.java:127)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.
      java:277)
      at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:40)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter
      .java:69)
      at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:140)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
      lter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
      icationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
      ilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
      alve.java:230)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
      alve.java:175)
      at org.jboss.web.tomcat.
      17:02:42,538 ERROR [STDERR] security.SecurityAssociationValve.invoke(SecurityAss
      ociationValve.java:179)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authentica
      torBase.java:433)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
      e.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
      ava:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
      ava:104)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
      onnectionValve.java:156)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
      ve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
      a:241)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
      :844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
      ss(Http11Protocol.java:580)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
      7)
      at java.lang.Thread.run(Thread.java:595)
      Caused by: javax.naming.NameNotFoundException: poctestEntityManagerFactory not b
      ound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager
      FactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:235)
      ... 109 more