0 Replies Latest reply on Mar 1, 2010 10:46 PM by sai burgula

    Could not instantiate Seam identity

    sai burgula Novice
      I get the following error after I run build and start the server.

      If I restart the server after the build then I am able to load the app. But if I make a change in my code, run ANT and try to start the app, it will give the following error. On a restart it works fine.

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

      The stack Trace is as follows:
      --------------------------------
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.security.identity
      at org.jboss.seam.Component.newInstance(Component.java:1986)
      at org.jboss.seam.Component.getInstance(Component.java:1876)
      at org.jboss.seam.Component.getInstance(Component.java:1843)
      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:177)
      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:72)
      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.UIComponentBase.isRendered(UIComponentBase.java:390)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:930)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
      at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
      at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
      at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:196)
      at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
      at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
      at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
      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.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.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:60)
      at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
      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.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:173)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
      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:241)
      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:447)
      at java.lang.Thread.run(Unknown Source)
      Caused by: org.jboss.seam.InstantiationException: Could not instantiate Seam component: securityRules
      at org.jboss.seam.Component.newInstance(Component.java:1986)
      at org.jboss.seam.Component.getInstance(Component.java:1876)
      at org.jboss.seam.Component.getInstance(Component.java:1843)
      at org.jboss.seam.security.RuleBasedIdentity.initSecurityContext(RuleBasedIdentity.java:62)
      at org.jboss.seam.security.RuleBasedIdentity.create(RuleBasedIdentity.java:55)
      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)
      at org.jboss.seam.Component.callComponentMethod(Component.java:2092)
      at org.jboss.seam.Component.callCreateMethod(Component.java:2015)
      at org.jboss.seam.Component.newInstance(Component.java:1976)
      ... 61 more
      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:2092)
      at org.jboss.seam.Component.callCreateMethod(Component.java:2015)
      at org.jboss.seam.Component.newInstance(Component.java:1976)
      ... 74 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.LinkageError: loader (instance of org/drools/base/ClassFieldExtractorFactory$ByteArrayClassLoader): attempted duplicate class definition for name: "org/drools/base/org/jboss/seam/security/Role20434023$getName"
      at java.lang.ClassLoader.defineClass1(Native Method)
      at java.lang.ClassLoader.defineClass(Unknown Source)
      at org.drools.base.ClassFieldExtractorFactory$ByteArrayClassLoader.defineClass(ClassFieldExtractorFactory.java:467)
      at org.drools.base.ClassFieldExtractorFactory.getClassFieldExtractor(ClassFieldExtractorFactory.java:116)
      at org.drools.base.ClassFieldExtractor.init(ClassFieldExtractor.java:109)
      at org.drools.base.ClassFieldExtractor.<init>(ClassFieldExtractor.java:72)
      at org.drools.base.ClassFieldExtractorCache.getExtractor(ClassFieldExtractorCache.java:44)
      at org.drools.rule.builder.PatternBuilder.getFieldExtractor(PatternBuilder.java:879)
      at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:284)
      at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:199)
      at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:168)
      at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:93)
      at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
      at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:43)
      at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
      at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:53)
      at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446)
      at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304)
      at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167)
      at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:58)
      ---------------------------------------------------------------------------------


      Let me also paste my security.drl file.


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



      package Permissions;

      import java.security.Principal;

      import org.jboss.seam.security.PermissionCheck;
      import org.jboss.seam.security.Role;

      rule "Listing All Roles"
      when
      $c: PermissionCheck (name == "dummy")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "CareerServices")||
      Role (name == "AlumniServices")||
      Role (name == "SuperUser")||
      Role (name == "Admissions")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
         then
         System.out.println("The PermissionCheck's properties are: " +
              "name=" + $c.getName() + ", action=" + $c.getAction());
         $c.grant();
      end;

      rule "View and Update US SSNs"
      when
         $c: PermissionCheck(name == "pii_us")
         Role(name == "SuperUser")
      then
         $c.grant();
      end;

           rule "View and Update AU Private Info"
      when
         $c: PermissionCheck(name == "pii_au")
         Role(name == "SuperUser")
      then
         $c.grant();
      end;

             rule "View Search Lookup"
      when
         $c: PermissionCheck(name == "searchLookup")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "CareerServices")||
      Role (name == "AlumniServices")||
      Role (name == "SuperUser")||
      Role (name == "Admissions")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
      then
          System.out.println("The PermissionCheck's properties are: " +
              "name=" + $c.getName() + ", action=" + $c.getAction());
         $c.grant();
      end;

      rule "View Datasheet Review"
      when
         $c: PermissionCheck(name == "dataSheetReview")
         Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
      then
          System.out.println("The PermissionCheck's properties are: " +
              "name=" + $c.getName() + ", action=" + $c.getAction());
         $c.grant();
      end;



      rule "View Demographics"
      when
         $c: PermissionCheck(name == "demographicsVw")
         Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "CareerServices")||
      Role (name == "AlumniServices")||
      Role (name == "SuperUser")||
      Role (name == "Admissions")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
      then
          System.out.println("The PermissionCheck's properties are: " +
              "name=" + $c.getName() + ", action=" + $c.getAction());
         $c.grant();
      end;

      rule "Update Demographics"
      when
      $c: PermissionCheck(name == "demographicsUpd")
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "Registrar")
      then
         $c.grant();
      end;

      rule "View Student Employment"
      when
      $c: PermissionCheck(name == "stu_employment_vw")
      Role (name == "Registrar") ||
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "CareerServices") ||
      Role (name == "AlumniServices") ||
      Role (name == "SuperUser")

      then
              $c.grant();
      end;

      rule "Update Student Employment"
      when
      $c: PermissionCheck(name == "stu_employment_upd")
      Role (name == "CareerServices") ||
      Role (name == "AlumniServices") ||
      Role (name == "SuperUser")

      then
             $c.grant();
      end;

      rule "View and Update Student Salary"
      when
      $c: PermissionCheck(name == "stu_employment_sal")
      Role (name == "SuperUser") ||
      Role (name == "CareerServices")
      then
              $c.grant();
      end;

      rule "View Student Notes"
      when
      $c: PermissionCheck(name == "stu_notes_view")
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "Admissions") ||
      Role (name == "FinancialAid") ||
      Role (name == "Registrar")
      then
             $c.grant();
      end;

      rule "Update Student Notes"
      when
      $c: PermissionCheck(name == "stu_notes_upd")
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "SuperUser") ||
      Role (name == "Admissions") ||
      Role (name == "FinancialAid") ||
      Role (name == "Registrar")
      then
              $c.grant();
      end;

      rule "View Student Internship"
      when
      $c: PermissionCheck(name == "stu_intern_view")
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "FinancialAid") ||
      Role (name == "Registrar")
      then
              $c.grant();
      end;

      rule "Update Student Internship"
      when
      $c: PermissionCheck(name == "stu_intern_upd")
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
              $c.grant();
      end;

      rule "View/Update Student Internship Salary"
      when
      $c: PermissionCheck(name == "stu_intern_sal")
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
              $c.grant();
      end;

      rule "View Internship Funding"
      when
      $c: PermissionCheck(name == "stu_intern_fund_view")
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
              $c.grant();
      end;

      rule "Update Internship Funding"
      when
      $c: PermissionCheck(name == "stu_intern_fund_upd")
      Role (name == "CareerServices") ||
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
             $c.grant();
      end;

      rule "Search Course"
      when
      $c: PermissionCheck(name == "crs_search")
      Role (name == "Registrar") ||
      Role(name == "ProgramDirector") ||
      Role(name == "AssociateDean") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "FCETemp") ||
      Role (name == "SuperUser")

      then
              $c.grant();
      end;

      rule "Update Course"
      when
      $c: PermissionCheck(name == "crs_search", action =="edit")
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
             $c.grant();
      end;


      rule "View Student Schedule And Petitions"
      when
      $c: PermissionCheck(name == "stu_schedule_view")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser") ||
      Role (name == "FinancialAid") ||
      Role (name == "Registrar")
      then
            $c.grant();
      end;


      rule "Add/Update/Delete Student Schedule and Petitions"
      when
      $c: PermissionCheck(name == "stu_schedule_upd")
      Role(name == "ProgramDirector")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
         $c.grant();
      end;

      rule "View Student Academic Info"
      when
      $c: PermissionCheck(name == "stu_acad_view")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
      then
         $c.grant();
      end;

      rule "Update Student Academic Info"
      when
      $c: PermissionCheck(name == "stu_acad_upd")
      Role(name == "ProgramDirector")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "Registrar")
      then
         $c.grant();
      end;

      rule "View Student Financial Aid Info"
      when
      $c: PermissionCheck(name == "stu_fin_aid")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "Admissions")||
      Role (name == "FinancialAid")||
      Role (name == "Registrar")
      then
         $c.grant();
      end;

      rule "Execute Reevaluate Core"
      when
      $c: PermissionCheck(name == "reeval_core")
      Role(name == "ProgramDirector")||
      Role(name == "AssociateDean")||
      Role (name == "FullTimeProgramCoordinator")||
      Role (name == "PartTimeProgramCoordinator")||
      Role (name == "AUProgramCoordinator")||
      Role (name == "PhdCoordinator")||
      Role (name == "SuperUser")||
      Role (name == "Registrar")
      then
         $c.grant();
      end;



      rule "Search Applicant"
      when
      $c: PermissionCheck(name == "appl_search")
      Role(name == "ProgramDirector") ||
      Role (name == "FullTimeProgramCoordinator") ||
      Role (name == "PartTimeProgramCoordinator") ||
      Role (name == "AUProgramCoordinator") ||
      Role (name == "PhdCoordinator") ||
      Role (name == "Registrar") ||
      Role (name == "Admissions") ||
      Role (name == "FinancialAid") ||
      Role(name == "AssociateDean") ||
      Role (name == "SuperUser")
      then
              $c.grant();
      end;

      rule "Update Applicant"
      when
      $c: PermissionCheck(name == "appl_search", action =="edit")
      Role (name == "SuperUser") ||
      Role (name == "Registrar")
      then
             $c.grant();
      end;

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

      Could someone help me out on this.

      Plz let me know if you need me to paste ANT script as well...


      By the way the jars in my lib are:

      antlr-runtime.jar
      core.jar
      drools-compiler.jar
      drools-core.jar
      jboss-el.jar
      jbpm-jpdl.jar
      mvel14.jar
      richfaces-api-3.2.2GA.jar

      Is there anything required or any changes needed.

      Plz let me knw.
      Looking forward for a reply