1 Reply Latest reply on Mar 10, 2009 2:02 PM by Senthil kumar

    Could not instantiate Seam component - glassfish

    Senthil kumar Newbie
      Hi guys,

              I am trying to deploy seam book example in glassfish. but I am getting the following Exception.

      persistence.xml
      ---------------

         <persistence-unit name="bookingDatabase" transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>     
            <jta-data-source>jdbc/bookingDatasource</jta-data-source>
            <properties>
               <property name="hibernate.show_sql" value="true"/>
               <property name="dialect" value="org.hibernate.dialect.MySQLDialect"/>
               <property name="hibernate.show_sql" value="true"/>        
                <property name="hibernate.transaction.manager_lookup_class"
                          value="org.hibernate.transaction.SunONETransactionManagerLookup" />        
            </properties>
         </persistence-unit>

      component.xml
      -------------

           <core:init jndi-pattern="myglass/#{ejbName}/local" debug="true" distributable="false"/>   
         
          <persistence:entity-manager-factory name="bookingDatabase"/>   
          <persistence:managed-persistence-context name="db1"
                                            auto-create="true"
                                            entity-manager-factory="#{bookingDatabase}"/>

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

      AuthenticatorAction.java
      ------------------------

      public class AuthenticatorAction implements Authenticator
      {
        
         @PersistenceContext(unitName="bookingDatabase")
         private EntityManager db1;
      ..

      I have no idea what can be wrong here. but its working in jboss.

      thanxs a lot
        • 1. Re: Could not instantiate Seam component - glassfish
          Senthil kumar Newbie


          Exception
          ---------


          Error invoking login method
          org.jboss.seam.InstantiationException: Could not instantiate Seam component: authenticator
                  at org.jboss.seam.Component.newInstance(Component.java:2106)
                  at org.jboss.seam.Component.getInstance(Component.java:1988)
                  at org.jboss.seam.Component.getInstance(Component.java:1950)
                  at org.jboss.seam.Component.getInstance(Component.java:1944)
                  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:166)
                  at org.jboss.seam.el.SeamELResolver.getValue(SeamELResolver.java:53)
                  at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                  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.getTarget(AstValue.java:34)
                  at org.jboss.el.parser.AstValue.invoke(AstValue.java:95)
                  at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                  at org.jboss.seam.core.Expressions$2.invoke(Expressions.java:175)
                  at org.jboss.seam.security.jaas.SeamLoginModule.login(SeamLoginModule.java:109)
                  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:597)
                  at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
                  at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
                  at javax.security.auth.login.LoginContext$5.run(LoginContext.java:706)
                  at java.security.AccessController.doPrivileged(Native Method)
                  at javax.security.auth.login.LoginContext.invokeCreatorPriv(LoginContext.java:703)
                  at javax.security.auth.login.LoginContext.login(LoginContext.java:575)
                  at org.jboss.seam.security.Identity.authenticate(Identity.java:344)
                  at org.jboss.seam.security.Identity.authenticate(Identity.java:332)
                  at org.jboss.seam.security.Identity.login(Identity.java:259)
                  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:597)
                  at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:329)
                  at org.jboss.el.util.ReflectionUtil.invokeMethod(ReflectionUtil.java:342)
                  at org.jboss.el.parser.AstPropertySuffix.invoke(AstPropertySuffix.java:58)
                  at org.jboss.el.parser.AstValue.invoke(AstValue.java:96)
                  at org.jboss.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)
                  at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                  at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
                  at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
                  at javax.faces.component.UICommand.broadcast(UICommand.java:383)
                  at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
                  at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
                  at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
                  at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
                  at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
                  at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
                  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
                  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                  at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:411)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:317)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
                  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:177)
                  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
                  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
                  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
                  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.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:230)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
                  at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
                  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230)
                  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:198)
                  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:288)
                  at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:271)
                  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:202)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
                  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
                  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:206)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
                  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:150)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:632)
                  at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:577)
                  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:571)
                  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1080)
                  at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:272)
                  at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:637)
                  at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:568)
                  at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:813)
                  at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
                  at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
                  at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
                  at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:265)
                  at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
          Caused by: javax.naming.NameNotFoundException
                  at com.sun.enterprise.naming.TransientContext.resolveContext(TransientContext.java:268)
                  at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:191)
                  at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:74)
                  at com.sun.enterprise.naming.LocalSerialContextProviderImpl.lookup(LocalSerialContextProviderImpl.java:111)
                  at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:398)
                  at javax.naming.InitialContext.lookup(InitialContext.java:392)
                  at org.jboss.seam.Component.instantiateSessionBean(Component.java:1367)
                  at org.jboss.seam.Component.instantiate(Component.java:1331)
                  at org.jboss.seam.Component.newInstance(Component.java:2084)
                  ... 100 more