1 Reply Latest reply on Jan 28, 2010 7:34 PM by gdfgd eqwe

    Seam 2.2.0.GA and Drools 5.0.1

    Fabrice Sommavilla Newbie

      I'm using Seam 2.2.0.GA, Drools 5.0.1 and Java 6. I get an error while using drools security.drl rules.


      The rule is the following :



      rule CanDoAnythingToServiceIfYouAreAnAdmin
      when
        c: PermissionCheck(target == "serviceManager")
        org.jboss.seam.security.Role(name == "admin")
      then
        c.grant();
      end;
      



      serviceManager is a seam bean and the following error occurs :



      Caused by: org.drools.rule.InvalidRulePackage: Unable to build expression for 'consequence': Failed to compile: 1 compilation error(s): 
       - (1,1) unqualified type in strict mode for: e '  c.grant();
      e' : [Rule name='CanDoAnythingToServiceIfYouAreAnAdmin']
      
           at org.drools.rule.Package.checkValidity(Package.java:477)
           at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:434)
           at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)
           at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:121)
           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.seam.util.Reflections.invoke(Reflections.java:22)
           at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:144)
           at org.jboss.seam.Component.callComponentMethod(Component.java:2249)
           at org.jboss.seam.Component.callCreateMethod(Component.java:2172)
           at org.jboss.seam.Component.newInstance(Component.java:2132)
           ... 103 more
      
      Unable to build expression for 'consequence': Failed to compile: 1 compilation error(s): 
       - (1,1) unqualified type in strict mode for: e '  c.grant(); 
      e' (/META-INF/security-rules.drl)




      Any clue on how to solve this ?


      Thanks. F