0 Replies Latest reply on Jan 8, 2013 9:44 PM by ravit

    Seam 2.2.0 and Drools throwing exception

    ravit

      Hi,

      I'm learning Drools in Seam 2.2.0.

      I trying to pass the instance of and session bean in @Restrict and getting following run time exception.

      The project is created using seam-gen.

      FYI - simple @Restrict tag fires rules correctly...here I target and action are hardcoded strings in the rule.

            

      PolicyAction.java

      ==============

      @Stateful

      @Name("policyAction")

      @Scope(ScopeType.SESSION)

      @Restrict("#{identity.loggedIn}")

      public class PolicyAction implements PolicyActionInterface

      {

           @PersistenceContext private EntityManager em;   

           @Logger    private static Log log;       

           private String searchString;

           private int pageSize = 10;    

           .......

           @Restrict("#{s:hasPermission(policyAction, 'check')}")

           public void save()

           {                           

                ........                

           }

       

      security.drl

      ==========

      package InsAppPermissions;

      import java.security.Principal;

      import org.jboss.seam.security.Role;

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

      import com.mydomain.InsApp.action.PolicyAction

       

      rule InstancePass  

           no-loop  

      when   

           e: PolicyAction(pageSize == 10)   

           c: PermissionCheck(target == e, action == "check")

      then   

           System.out.println("******** security.drl: InstancePass ****************");   

           c.grant();

      end

       

      Exception Message  (This is part of the message along with a stack trace..I'm showing the stack as not sure what part to show)

      ===================

      Exception during request processing:

      Caused by javax.servlet.ServletException with message: "#{policyAction.save}: javax.el.ELException: java.lang.IllegalArgumentException: not a proxy instance"

      .................

      Caused by javax.faces.FacesException with message: "#{policyAction.save}: javax.el.ELException: java.lang.IllegalArgumentException: not a proxy instance"

      .....................

      Caused by javax.faces.el.EvaluationException with message: "javax.el.ELException: java.lang.IllegalArgumentException: not a proxy instance"

      ................

      Caused by javax.el.ELException with message: "java.lang.IllegalArgumentException: not a proxy instance"

      ..............

      Caused by java.lang.IllegalArgumentException with message: "not a proxy instance"

       

       

      Thank you all in advance.