2 Replies Latest reply on Mar 2, 2010 4:02 PM by sai burgula

    instantiation of 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
        • 1. Re: instantiation of Seam Identity
          elfuhrer Novice

          There's a duplication of your classes, make sure you clean them upon re-deployment of your app, that's why a restart works fine.
          One workaround is to let your ant script clean up the duplications and then redeploy the app

          • 2. Re: instantiation of Seam Identity
            sai burgula Novice
            Thanks for the immediate reply.  I really appreciate it.  I can paste my ANT script.  Could you let me know if you can see something that is incorrect.

            --------------------------------------------------------------------------
            ANT SCRIPT
            ----------



            <?xml version="1.0"?>

            <project name="hcis" default="deploy" basedir=".">

                 <import file="${basedir}/ivy.build.xml"/>
                 <!-- Give user a chance to override without editing this file or typing -D -->
                 <property file="${basedir}/build.properties" />

                 <property name="profile" value="dev" />
                 <property file="build-${profile}.properties" />

                 <!-- set global properties for this build -->
                 <property name="project.name" value="hcis"/>
                 <property name="dist.dir" value="build/dist" />
                 <property name="src.model.dir" value="src/main/java" />
                 <property name="src.action.dir" value="src/main/java" />
                 <property name="src.test.dir" value="src/test/java" />
                 <property name="resources.dir" value="src/main/resources" />
                 <property name="lib.dir" value="lib" />
                 <property name="ear.dir" value="build/exploded-archives/${project.name}.ear" />
                 <property name="jar.dir" value="build/exploded-archives/${project.name}.jar" />
                 <property name="war.dir" value="build/exploded-archives/${project.name}.war" />
                 <property name="test.dir" value="test-build" />
                 <property name="bootstrap.dir" value="${basedir}/bootstrap" />
                 <property name="deploy.dir" value="${jboss.home}/server/${jboss.domain}/deploy" />
                 <property name="ear.deploy.dir" value="${deploy.dir}/${project.name}.ear" />
                 <property name="jar.deploy.dir" value="${ear.deploy.dir}/${project.name}.jar" />
                 <property name="war.deploy.dir" value="${ear.deploy.dir}/${project.name}.war" />
                 <property name="testng.jar" value="${basedir}/lib/testng.jar" />
                 <property name="javac.debug" value="true" />
                 <property name="javac.deprecation" value="false" />
                 <property name="debug" value="false" />

                 <!--Properties for validating configuration files -->
                 <property name="validate.resources.dir" value="${basedir}/exploded-archives" />
                 <property name="schema.dir" value="${basedir}/exploded-archives/schemas" />
                 <property name="src.schema.dir" value="${schema.dir}/org/jboss/seam"/>
                 <property name="schema.version" value="2.0" />

                 <fileset id="lib" dir="${lib.dir}">
                      <include name="*.jar" />
                 </fileset>

                 <path id="build.classpath">
                      <fileset dir="${jboss.home}/server/${jboss.domain}/lib" includes="*.jar"/>
                      <fileset refid="lib" />
                 </path>

                 <target name="init" description="Initialize the build">
                      <mkdir dir="${jar.dir}" />
                      <mkdir dir="${ear.dir}" />
                      <mkdir dir="${war.dir}" />
                      <mkdir dir="${dist.dir}" />
                 </target>

                 <target name="compile" depends="init"
                      description="Compile the Java source code">
                      <javac classpathref="build.classpath"
                           destdir="${jar.dir}"
                           debug="${javac.debug}"
                           deprecation="${javac.deprecation}"
                           nowarn="on">
                           <src path="${src.model.dir}" />
                           <src path="${src.action.dir}" />
                      </javac>
                 </target>


                 <target name="jar" depends="compile"
                      description="Build the distribution .jar file">
                      <copy todir="${jar.dir}">
                           <fileset dir="${basedir}/src/main/resources">
                                <include name="seam.properties" />
                           </fileset>
                      </copy>
                      <copy todir="${jar.dir}">
                                     <fileset dir="${basedir}/src/main/resources">
                                          <include name="*.drl" />
                                          
                                     </fileset>
                      </copy>
                      <copy todir="${jar.dir}/META-INF">
                           <fileset dir="${basedir}/src/main/resources/META-INF">
                                <include name="ejb-jar.xml" />
                                <include name="orm.xml"/>
                           </fileset>
                      </copy>
                      <copy tofile="${jar.dir}/META-INF/persistence.xml"
                           file="${basedir}/src/main/resources/META-
                                             INF/persistence-${profile}.xml" overwrite="true"/>
                      <copy tofile="${jar.dir}/import.sql"
                           file="${basedir}/src/main/resources/import.sql" overwrite="true"/>
                 </target>

                 <target name="war" depends="compile"
                      description="Build the distribution .war file">
                      <copy todir="${war.dir}">
                           <fileset dir="${basedir}/WebContent" />
                      </copy>
                      <copy tofile="${war.dir}/WEB-INF/classes/components.properties"
                                  file="${resources.dir}/components-${profile}.properties"
                                  overwrite="true"/>
                      <copy todir="${war.dir}/WEB-INF">
                           <fileset dir="${basedir}/WebContent/WEB-INF">
                                <include name="*.*"/>
                                <include name="classes/**/*.*"/>
                                <exclude name="classes/**/*.class"/>
                           </fileset>
                      </copy>
                      <copy todir="${war.dir}/WEB-INF">
                           <fileset dir="${basedir}/WebContent/WEB-INF">
                                <include name="*.xml"/>
                           </fileset>
                           <filterset>
                                <filter token="debug" value="${debug}" />
                                <filter token="jndiPattern" value="${project.name}/
                                                                                  {ejbName}/local" />
                                <filter token="embeddedEjb" value="false" />
                           </filterset>
                      </copy>        
                      <copy todir="${war.dir}/WEB-INF">
                           <fileset dir="${basedir}/WebContent/WEB-INF">
                                <include name="lib/*.*"/>
                                <include name="classes/**/*.class"/>
                           </fileset>
                      </copy>        
                      <copy todir="${war.dir}/WEB-INF/lib">
                           <fileset dir="${lib.dir}">
                                <includesfile name="deployed-jars-war.list" />
                                <exclude name="jboss-seam-gen.jar" />
                           </fileset>
                      </copy>
                      <copy todir="${war.dir}/WEB-INF/classes">
                           <fileset dir="${basedir}/WebContent">
                                <include name="messages*.properties"/>
                           </fileset>
                      </copy>
                 </target>

                 <target name="ear" description="Build the EAR">
                      <copy todir="${ear.dir}">
                           <fileset dir="${basedir}/resources">
                                <include name="*jpdl.xml" />
                                <include name="*hibernate.cfg.xml" />
                                <include name="jbpm.cfg.xml" />
                           </fileset>
                           
                           <fileset dir="${basedir}/src/main/resources">
                                <include name="application.properties" />
                           </fileset>
                           
                           <fileset dir="${lib.dir}">
                                <include name="jboss-seam.jar" />
                           </fileset>
                      </copy>
                      <copy todir="${ear.dir}/lib">
                           <fileset dir="${lib.dir}">
                                <includesfile name="deployed-jars-ear.list" />
                           </fileset>
                      </copy>
                      <copy todir="${ear.dir}/META-INF">
                           <fileset dir="${basedir}/src/main/resources/META-INF">
                                <include name="application.xml" />
                                <include name="jboss-app.xml" />
                           </fileset>
                      </copy>
                 </target>

                 <target name="archive" depends="jar,war,ear"
                      description="Package the archives">
                      <jar jarfile="${dist.dir}/${project.name}.jar" basedir="${jar.dir}"/>
                      <jar jarfile="${dist.dir}/${project.name}.war" basedir="${war.dir}"/>
                      <jar jarfile="${dist.dir}/${project.name}.ear">
                           <fileset dir="${ear.dir}"/>
                           <fileset dir="${dist.dir}">
                                <include name="${project.name}.jar"/>
                                <include name="${project.name}.war"/>
                           </fileset>
                      </jar>
                 </target>

                 <target name="datasource">
                      <fail unless="jboss.home">jboss.home not set</fail>
                      <copy todir="${deploy.dir}">
                           <fileset dir="${basedir}/resources">
                                <include name="${project.name}-${profile}-ds.xml" />
                           </fileset>
                      </copy>
                 </target>

                 <target name="explode" depends="jar,war,ear,datasource"
                      description="Deploy the exploded archive">
                      <fail unless="jboss.home">jboss.home not set</fail>

                      <mkdir dir="${jar.deploy.dir}"/>
                      <mkdir dir="${war.deploy.dir}"/>               

                      <copy todir="${jar.deploy.dir}">
                           <fileset dir="${jar.dir}"/>
                      </copy>
                      <copy todir="${war.deploy.dir}">
                           <fileset dir="${war.dir}"/>
                      </copy>
                      <copy todir="${ear.deploy.dir}">
                           <fileset dir="${ear.dir}"/>
                      </copy>
                 </target>

                 <target name="unexplode" description="Undeploy the exploded archive">
                      <delete failonerror="no">
                           <fileset dir="${ear.deploy.dir}">
                                <exclude name="**/*.jar"/>
                           </fileset>
                      </delete>
                      <delete file="${deploy.dir}/${project.name}-${profile}-ds.xml"
                                                                       failonerror="no"/>
                      <delete dir="${ear.deploy.dir}" failonerror="no"/>
                 </target>

                 <target name="restart" depends="explode" description="Restart the exploded
                                                                             archive">
                      <touch file="${ear.deploy.dir}/META-INF/application.xml"/>
                 </target>

                 <target name="deploy" depends="archive,datasource" description="Deploy to JBoss
                                                                                       AS">
                      <fail unless="jboss.home">jboss.home not set</fail>
                      <copy todir="${deploy.dir}" file="${dist.dir}/${project.name}.ear" />
                 </target>

                 <target name="undeploy" description="Undeploy the example from JBoss">
                      <delete file="${deploy.dir}/${project.name}.ear" />
                 </target>

                 <target name="redeploy" depends="undeploy,clean,deploy"
                    description="Undeploy the packaged archive, clean, then deploy the packaged
                                                                              archive"/>

                 <target name="clean" description="Cleans up the build directory">
                      <delete dir="${dist.dir}"/>
                      <delete dir="${ear.dir}"/>
                      <delete dir="${war.dir}"/>
                      <delete dir="${jar.dir}"/>
                      <delete dir="${src.schema.dir}" failonerror="no"/>
                      <delete dir="${basedir}/test-report"/>
                      <delete dir="${basedir}/test-output"/>
                      <delete failonerror="no">
                           <fileset dir="${test.dir}">
                                <exclude name="**/*.class" if="eclipse.running"/>
                           </fileset>
                      </delete>
                 </target>

                 <target name="compiletest" description="Compile the Java source code for the
                                                                          tests">
                      <mkdir dir="${test.dir}"/>
                      <javac classpathref="build.classpath"
                           destdir="${test.dir}"
                           debug="${javac.debug}"
                           deprecation="${javac.deprecation}"
                           nowarn="on">
                           <src path="${src.action.dir}" />
                           <src path="${src.model.dir}" />
                           <src path="${src.test.dir}" />
                      </javac>
                 </target>

                 

                 <target name="buildtest" depends="compiletest" description="Build the tests">
                      <copy todir="${test.dir}">
                           <fileset dir="${basedir}/resources">
                                <exclude name="META-INF/persistence*.xml"/>
                                <exclude name="import*.sql"/>
                                <exclude name="${project.name}-*-ds.xml"/>
                                <exclude name="components-*.properties"/>
                           </fileset>
                      </copy>
                      <copy tofile="${test.dir}/META-INF/persistence.xml"
                           file="${basedir}/resources/META-INF/persistence-test.xml"
                           overwrite="true"/>
                      <copy tofile="${test.dir}/import.sql"
                           file="${basedir}/resources/import-test.sql"
                           overwrite="true"/>
                      <copy todir="${test.dir}" flatten="true">
                           <fileset dir="${src.test.dir}">
                                <include name="**/*Test.xml" />
                           </fileset>
                      </copy>
                 </target>

                 <target name="test" depends="buildtest" description="Run the tests">           
                      <taskdef resource="testngtasks" classpath="${testng.jar}" />
                      <path id="test.path">
                           <path path="${test.dir}" />
                           <fileset dir="${lib.dir}/test">
                                <include name="*.jar"/>
                           </fileset>
                           <path path="${bootstrap.dir}" />
                           <path refid="build.classpath" />
                      </path>
                      <testng outputdir="${basedir}/test-report">
                           <jvmarg line="-Djava.endorsed.dirs=${endorsed.dir}"/>
                           <jvmarg line="-Dsun.lang.ClassLoader.allowArraySyntax=true"/>
                           <classpath refid="test.path" />
                           <xmlfileset dir="${test.dir}" includes="*Test.xml" />
                      </testng>
                 </target>

                 <target name="validateConfiguration" depends="war,ear,jar" description="Validate
                                                                         the xml configuration files">
                      <mkdir dir="${schema.dir}"/>
                      <unjar src="${lib.dir}/jboss-seam.jar" dest="${schema.dir}">
                           <patternset>
                                <include name="org/jboss/seam/*.xsd"/>
                                <include name="org/jboss/seam/*.dtd"/>
                           </patternset>
                      </unjar>
                      <ant antfile="validate.xml" target="validateConfiguration" />
                 </target>

            </project>

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

            Thanks again for pointing out.

            Sai