3 Replies Latest reply on Mar 24, 2009 9:53 PM by Joshua Davis

    Could not instantiate Seam component problem: org.jboss.seam.security.identity

    Rajesh kumar Newbie
      Hi,
      I am getting could not instantiate seam component, when trying to run my application. My application compile fine, I am able to trace error. please help..


      Error is

      12:19:58,562 ERROR Session event listener threw exception
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
              at org.jboss.seam.Component.newInstance(Component.java:1970)
              at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
              at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
              at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:191)
              at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
              at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:44)
              at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
              at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369)
              at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:828)
              at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291)
              at org.apache.catalina.connector.Request.doGetSession(Request.java:2310)
              at org.apache.catalina.connector.Request.getSession(Request.java:2075)
              at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
              at com.sun.faces.context.SessionMap.getSession(ExternalContextImpl.java:1002)
              at com.sun.faces.context.SessionMap.get(ExternalContextImpl.java:962)
              at org.jboss.seam.contexts.BasicContext.get(BasicContext.java:48)
              at org.jboss.seam.Component.getInstance(Component.java:1851)
              at org.jboss.seam.Component.getInstance(Component.java:1829)
              at org.jboss.seam.web.Session.getInstance(Session.java:122)
              at org.jboss.seam.contexts.FacesLifecycle.beginRequest(FacesLifecycle.java:54)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeRestoreView(SeamPhaseListener.java:366)
              at org.jboss.seam.jsf.SeamPhaseListener.beforeServletPhase(SeamPhaseListener.java:137)
              at org.jboss.seam.jsf.SeamPhaseListener.beforePhase(SeamPhaseListener.java:114)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
              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.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.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              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.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(Unknown Source)
      Caused by: java.lang.RuntimeException: exception invoking: compileRuleBase
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:135)
              at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
              at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
              at org.jboss.seam.Component.newInstance(Component.java:1976)
              at org.jboss.seam.Component.getInstance(Component.java:1873)
              at org.jboss.seam.Component.getInstance(Component.java:1840)
              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: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.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
              at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
              at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2360)
              at org.jboss.seam.Component.initialize(Component.java:1389)
              at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
              at org.jboss.seam.Component.instantiate(Component.java:1268)
              at org.jboss.seam.Component.newInstance(Component.java:1966)
              ... 58 more
      Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
              ... 77 more
      Caused by: java.lang.NoClassDefFoundError: org/antlr/runtime/CharStream
              at org.drools.rule.builder.dialect.java.JavaDialect.init(JavaDialect.java:120)
              at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
              at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:146)
              at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:108)
              at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:41)
              ... 83 more
      Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for: org.antlr.runtime.CharStream
              at org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
              at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              ... 88 more
      12:19:58,656 ERROR [SeamPhaseListener] uncaught exception
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
              at org.jboss.seam.Component.newInstance(Component.java:1970)
              at org.jboss.seam.Component.getInstance(Component.java:1873)
              at org.jboss.seam.Component.getInstance(Component.java:1852)
              at org.jboss.seam.Component.getInstance(Component.java:1829)
              at org.jboss.seam.Component.getInstance(Component.java:1824)
              at org.jboss.seam.security.Identity.instance(Identity.java:123)
              at org.jboss.seam.navigation.Pages.isLoginRedirectRequired(Pages.java:430)
              at org.jboss.seam.navigation.Pages.postRestore(Pages.java:370)
              at org.jboss.seam.jsf.SeamPhaseListener.postRestorePage(SeamPhaseListener.java:533)
              at org.jboss.seam.jsf.SeamPhaseListener.afterRestoreView(SeamPhaseListener.java:379)
              at org.jboss.seam.jsf.SeamPhaseListener.afterServletPhase(SeamPhaseListener.java:216)
              at org.jboss.seam.jsf.SeamPhaseListener.afterPhase(SeamPhaseListener.java:182)
              at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:280)
              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.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.LoggingFilter.doFilter(LoggingFilter.java:58)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
              at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
              at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
              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.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(Unknown Source)
      Caused by: java.lang.IllegalArgumentException: could not set property value: org.jboss.seam.security.identity.setSecurityRules
              at org.jboss.seam.Component.setPropertyValue(Component.java:1777)
              at org.jboss.seam.Component.initialize(Component.java:1390)
              at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
              at org.jboss.seam.Component.instantiate(Component.java:1268)
              at org.jboss.seam.Component.newInstance(Component.java:1966)
              ... 47 more
      Caused by: java.lang.IllegalArgumentException: Could not invoke method by reflection: RuleBasedIdentity.setSecurityRules(org.drools.RuleBase) with parameters: (org.jboss.seam.drools.RuleBase) on: org.jboss.seam.security.RuleBasedIdentity
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:31)
              at org.jboss.seam.Component.setPropertyValue(Component.java:1773)
              ... 51 more
      Caused by: java.lang.IllegalArgumentException: argument type mismatch
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
              at java.lang.reflect.Method.invoke(Unknown Source)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              ... 52 more




      My component.xml---


      <?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:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:transaction="http://jboss.com/products/seam/transaction"
                  xsi:schemaLocation=
                      "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">

         <core:init debug="@debug@" jndi-pattern="@jndiPattern@"/>
          
         <core:manager concurrent-request-timeout="500"
                       conversation-timeout="120000"
                       conversation-id-parameter="cid"
                       parent-conversation-id-parameter="pid"/>
         
         <persistence:managed-persistence-context name="entityManager"
                                           auto-create="true"
                            persistence-unit-jndi-name="java:/easy2studyEntityManagerFactory"/>                         

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

         <security:identity security-rules="#{securityRules}" 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="2525" username="test" password="test" />
        
         <transaction:ejb-transaction/>
             
         <!-- For use with jBPM pageflow or process management -->
         <!-- 
         <bpm:jbpm>
            <bpm:process-definitions></bpm:process-definitions>
            <bpm:pageflow-definitions></bpm:pageflow-definitions>
         </bpm:jbpm>
         -->
              <component class="org.jboss.seam.web.MultipartFilter">
                      <property name="createTempFiles">true</property>
                      <property name="maxRequestSize">4194304</property>
              </component>
           
      </components>


      I am new for seam, pleas help me...
      Thanks in advance

      Thanks
      Rajesh


      ""