5 Replies Latest reply on Apr 10, 2010 10:18 PM by sara sara

    could not instantiate seam componenet

    sara sara Newbie
      Boujour,

      Je sais que ce problème a été exposé maintes fois, mais ça ne m'a pas aidé.
      j'ai généré une application CRUD à partir d'une base de données Oracle 10g. Quand j'essaie d'ouvrir l'une des interfaces générée, j'obtiens un "could not instantiate seam component".

      mon stack trace est tel que:

      org.jboss.seam.InstantiationException: Could not instantiate Seam component: personneList
           at org.jboss.seam.Component.newInstance(Component.java:2144)
           at org.jboss.seam.Component.getInstance(Component.java:2021)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
           at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
           at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:147)
           at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.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:186)
           at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
           at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
           at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
           at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
           at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
           at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
           at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:152)
           at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
           at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
           at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:347)
           at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:342)
           at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
           at org.richfaces.renderkit.html.SimpleTogglePanelRenderer.encodeChildren(SimpleTogglePanelRenderer.java:201)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
           at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
           at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
           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.java:592)
           at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.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(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
           at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
           at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
           at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
           at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
           at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
           at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
           at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/totoEntityManagerFactory
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
           at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
           at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.unwrap(Component.java:2275)
           at org.jboss.seam.Component.getInstance(Component.java:2041)
           at org.jboss.seam.Component.getInstance(Component.java:1983)
           at org.jboss.seam.Component.getInstance(Component.java:1977)
           at org.jboss.seam.Component.getInstance(Component.java:1972)
           at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272)
           at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20)
           at org.jboss.seam.framework.EntityQuery.getEntityManager(EntityQuery.java:159)
           at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:39)
           at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
           at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
           at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           at org.domain.toto.session.PersonneList_$$_javassist_seam_3.validate(PersonneList_$$_javassist_seam_3.java)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:585)
           at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
           at org.jboss.seam.Component.newInstance(Component.java:2132)
           ... 83 more
      Caused by: javax.naming.NameNotFoundException: totoEntityManagerFactory not bound
           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:667)
           at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
           at javax.naming.InitialContext.lookup(InitialContext.java:351)
           at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
           ... 127 more




      mon fichier components.xml est tel que:

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                  xmlns:core="http://jboss.com/products/seam/core"
                  xmlns:persistence="http://jboss.com/products/seam/persistence"
                  xmlns:drools="http://jboss.com/products/seam/drools"
                  xmlns:bpm="http://jboss.com/products/seam/bpm"
                  xmlns:security="http://jboss.com/products/seam/security"
                  xmlns:mail="http://jboss.com/products/seam/mail"
                  xmlns:web="http://jboss.com/products/seam/web"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">

      <!--   <core:init debug="true" jndi-pattern="@jndiPattern@"/>-->
        
          <core:init debug="true" jndi-pattern="toto-ear/#{ejbName}/local"/>

         <core:manager concurrent-request-timeout="500"
                       conversation-timeout="120000"
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>

         <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
         <web:hot-deploy-filter url-pattern="*.seam"/>

         <persistence:managed-persistence-context name="entityManager" auto-create="true"
                            persistence-unit-jndi-name="java:/totoEntityManagerFactory"/>

         <drools:rule-base name="securityRules">
            <drools:rule-files>
               <value>/security.drl</value>
            </drools:rule-files>
         </drools:rule-base>

         <security:rule-based-permission-resolver security-rules="#{securityRules}"/>

         <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>

         <event type="org.jboss.seam.security.notLoggedIn">
            <action execute="#{redirect.captureCurrentView}"/>
         </event>
         <event type="org.jboss.seam.security.loginSuccessful">
            <action execute="#{redirect.returnToCapturedView}"/>
         </event>

         <mail:mail-session host="localhost" port="25"/>

         <!-- For use with jBPM pageflow or process management -->
         <!--
         <bpm:jbpm>
            <bpm:process-definitions></bpm:process-definitions>
            <bpm:pageflow-definitions></bpm:pageflow-definitions>
         </bpm:jbpm>
         -->

      </components>




      d'habitude on conseille de remplacer :

      <core:init debug="true" jndi-pattern="@jndiPattern@"/> 
      par:
      <core:init debug="true" jndi-pattern="toto-ear/#{ejbName}/local"/>

      mais ça n'a pas marché pour moi.

      je serais reconnaissante pour votre aide.

      Merci d'avance.
        • 1. Re: could not instantiate seam componenet
          sara sara Newbie
          Hi,

          Sorry. well i have the same problem as the others. the only deffrence is that i tried the proposed solutions and it did not work.
          I generated a CRUD application using Oracle 10g DB and Jboss seam. Once i open one of the generated views, i get a "could not instantiate seam component" Exception.

          My stack trace is:

          org.jboss.seam.InstantiationException: Could not instantiate Seam component: personneList
          at org.jboss.seam.Component.newInstance(Component.java:2144)
          at org.jboss.seam.Component.getInstance(Component.java:2021)
          at org.jboss.seam.Component.getInstance(Component.java:1983)
          at org.jboss.seam.Component.getInstance(Component.java:1977)
          at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:55)
          at org.jboss.seam.Namespace.getComponentInstance(Namespace.java:50)
          at org.jboss.seam.el.SeamELResolver.resolveBase(SeamELResolver.java:147)
          at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:51)
          at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
          at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.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:186)
          at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
          at javax.faces.component.UIOutput.getValue(UIOutput.java:173)
          at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:189)
          at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:320)
          at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:200)
          at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:836)
          at org.jboss.seam.ui.util.cdk.RendererBase.renderChild(RendererBase.java:190)
          at org.jboss.seam.ui.util.cdk.RendererBase.renderChildren(RendererBase.java:166)
          at org.jboss.seam.ui.renderkit.DecorateRendererBase.doEncodeChildren(DecorateRendererBase.java:152)
          at org.jboss.seam.ui.util.cdk.RendererBase.encodeChildren(RendererBase.java:92)
          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:282)
          at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:262)
          at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:347)
          at org.richfaces.renderkit.html.SimpleToggleControlTemplate.doEncodeChildren(SimpleToggleControlTemplate.java:342)
          at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:121)
          at org.richfaces.renderkit.html.SimpleTogglePanelRenderer.encodeChildren(SimpleTogglePanelRenderer.java:201)
          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:886)
          at javax.faces.render.Renderer.encodeChildren(Renderer.java:137)
          at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:812)
          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.java:592)
          at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
          at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
          at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.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(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
          at org.jboss.seam.web.IdentityFilter.doFilter(IdentityFilter.java:40)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:90)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:45)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)
          at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.web.HotDeployFilter.doFilter(HotDeployFilter.java:53)
          at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
          at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
          at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
          at java.lang.Thread.run(Thread.java:595)
          Caused by: java.lang.IllegalArgumentException: EntityManagerFactory not found in JNDI : java:/totoEntityManagerFactory
          at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:245)
          at org.jboss.seam.persistence.ManagedPersistenceContext.initEntityManager(ManagedPersistenceContext.java:78)
          at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManager(ManagedPersistenceContext.java:107)
          at sun.reflect.GeneratedMethodAccessor162.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
          at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
          at org.jboss.seam.Component.unwrap(Component.java:2275)
          at org.jboss.seam.Component.getInstance(Component.java:2041)
          at org.jboss.seam.Component.getInstance(Component.java:1983)
          at org.jboss.seam.Component.getInstance(Component.java:1977)
          at org.jboss.seam.Component.getInstance(Component.java:1972)
          at org.jboss.seam.framework.Controller.getComponentInstance(Controller.java:272)
          at org.jboss.seam.framework.PersistenceController.getPersistenceContext(PersistenceController.java:20)
          at org.jboss.seam.framework.EntityQuery.getEntityManager(EntityQuery.java:159)
          at org.jboss.seam.framework.EntityQuery.validate(EntityQuery.java:39)
          at sun.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
          at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:32)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
          at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.transaction.TransactionInterceptor$1.work(TransactionInterceptor.java:97)
          at org.jboss.seam.util.Work.workInTransaction(Work.java:47)
          at org.jboss.seam.transaction.TransactionInterceptor.aroundInvoke(TransactionInterceptor.java:91)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
          at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
          at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
          at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
          at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
          at org.domain.toto.session.PersonneList_$$_javassist_seam_3.validate(PersonneList_$$_javassist_seam_3.java)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:585)
          at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
          at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
          at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
          at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
          at org.jboss.seam.Component.newInstance(Component.java:2132)
          ... 83 more
          Caused by: javax.naming.NameNotFoundException: totoEntityManagerFactory not bound
          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:667)
          at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
          at javax.naming.InitialContext.lookup(InitialContext.java:351)
          at org.jboss.seam.persistence.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:241)
          ... 127 more




          My components.xml is:

          <?xml version="1.0" encoding="UTF-8"?>
          <components xmlns="http://jboss.com/products/seam/components"
                      xmlns:core="http://jboss.com/products/seam/core"
                      xmlns:persistence="http://jboss.com/products/seam/persistence"
                      xmlns:drools="http://jboss.com/products/seam/drools"
                      xmlns:bpm="http://jboss.com/products/seam/bpm"
                      xmlns:security="http://jboss.com/products/seam/security"
                      xmlns:mail="http://jboss.com/products/seam/mail"
                      xmlns:web="http://jboss.com/products/seam/web"
                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                      xsi:schemaLocation=
                          "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.1.xsd
                           http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.1.xsd
                           http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.1.xsd
                           http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.1.xsd
                           http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.1.xsd
                           http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.1.xsd
                           http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.1.xsd
                           http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.1.xsd">

          <!-- <core:init debug="true" jndi-pattern="@jndiPattern@"/>-->
                  <core:init debug="true" jndi-pattern="toto-ear/#{ejbName}/local"/>

             <core:manager concurrent-request-timeout="500"
                           conversation-timeout="120000"
                           conversation-id-parameter="cid"
                           parent-conversation-id-parameter="pid"/>

             <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
             <web:hot-deploy-filter url-pattern="*.seam"/>

             <persistence:managed-persistence-context name="entityManager" auto-create="true"
                                persistence-unit-jndi-name="java:/totoEntityManagerFactory"/>

             <drools:rule-base name="securityRules">
                <drools:rule-files>
                   <value>/security.drl</value>
                </drools:rule-files>
             </drools:rule-base>

             <security:rule-based-permission-resolver security-rules="#{securityRules}"/>

             <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>

             <event type="org.jboss.seam.security.notLoggedIn">
                <action execute="#{redirect.captureCurrentView}"/>
             </event>
             <event type="org.jboss.seam.security.loginSuccessful">
                <action execute="#{redirect.returnToCapturedView}"/>
             </event>

             <mail:mail-session host="localhost" port="25"/>

             <!-- For use with jBPM pageflow or process management -->
             <!--
             <bpm:jbpm>
                <bpm:process-definitions></bpm:process-definitions>
                <bpm:pageflow-definitions></bpm:pageflow-definitions>
             </bpm:jbpm>
             -->

          </components>




          Usualy we suggest to replace:

          <core:init debug="true" jndi-pattern="@jndiPattern@"/>
          with:
          <core:init debug="true" jndi-pattern="toto-ear/#{ejbName}/local"/>

          though it didn't work.

          i'll be happy to get some help.

          Thx.

          New Reply
          Subject:
                  Help
          Click HELP for text formatting instructions. Then edit this text and check the preview.
          Let me type some plain text, not markup
          Enable live preview

          SaveCancel

          © Copyright 2009, Red Hat Middleware, LLC. All rights reserved. JBoss and Seam are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]
          • 2. Re: could not instantiate seam componenet
            Thomas Küstermann Newbie

            Look at your stacktrace, your EntityManager is not accessible:



            Caused by: javax.naming.NameNotFoundException: totoEntityManagerFactory not bound

            You should check your persistence configuration.


            • 3. Re: could not instantiate seam componenet
              sara sara Newbie
              here is my persistence.xml

              <?xml version="1.0" encoding="UTF-8"?>
              <!-- Persistence deployment descriptor for dev profile -->
              <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_1_0.xsd"
                           version="1.0">
                          
                 <persistence-unit name="toto" >
                    <provider>org.hibernate.ejb.HibernatePersistence</provider>
                    <jta-data-source>java:/totoDatasource</jta-data-source>
                   <!--   The <jar-file> element is necessary if you put the persistence.xml in the WAR and the classes in the JAR
                   
                    <jar-file>../../vehicles.jar</jar-file>
                    -->
                    <properties>
                       <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
                       <property name="hibernate.hbm2ddl.auto" value="validate"/>
                       <property name="hibernate.show_sql" value="true"/>
                       <property name="hibernate.format_sql" value="true"/>
                       <property name="hibernate.default_schema" value="INTRANET"/>
                       <property name="jboss.entity.manager.factory.jndi.name" value="java:/totoEntityManagerFactory"/>
                    </properties>
                 </persistence-unit>
                       
              </persistence>
              • 4. Re: could not instantiate seam componenet
                Thomas Küstermann Newbie

                Your configuration looks OK to me. You should verify the following:



                1. Your DataSource is correctly deployed

                2. Hibernate is correctly initialized



                If Hibernate initialization fails, your EntityManagerFactory won't be bound to JNDI. You should be able to see any errors in the servers log files.


                Some other hints:



                • Hibernate



                <property name="hibernate.hbm2ddl.auto" value="validate"/>



                You configured Hibernate to validate your mappings which could have failed. It's also possible that a query has errors.



                • Data Source



                <jta-data-source>java:/totoDatasource</jta-data-source>



                Please verify that you don't use


                <use-java-context>false</use-java-context>



                in your DataSource configuration.


                By the way: Please use code blocks if you post any code snippets in the future (it's easier to read).

                • 5. Re: could not instantiate seam componenet
                  sara sara Newbie

                  Thanks a lot for the help you provided.


                  it figured out that the server couldn't access the datasource file. once the problem resolved, it worked like a charm.


                  Thanks again. :)