8 Replies Latest reply on Mar 15, 2007 9:52 PM by Stuart Douglas

    Exception with rule based security

    Stuart Douglas Master

      I keep getting an exception when I try and use use based security. I have following the directions in the docs, but I keep getting an exception:


      16:21:02,557 ERROR [STDERR] StringTemplate: problem parsing group <unknown>: java.lang.ClassCastException: antlr.CommonToken
      16:21:02,562 ERROR [STDERR] java.lang.ClassCastException: antlr.CommonToken
      16:21:02,569 ERROR [STDERR] at antlr.CharScanner.makeToken(CharScanner.java:173)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupLexer.mID(GroupLexer.java:333)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupLexer.nextToken(GroupLexer.java:103)
      16:21:02,569 ERROR [STDERR] at antlr.TokenBuffer.fill(TokenBuffer.java:69)
      16:21:02,569 ERROR [STDERR] at antlr.TokenBuffer.LA(TokenBuffer.java:80)
      16:21:02,569 ERROR [STDERR] at antlr.LLkParser.LA(LLkParser.java:52)
      16:21:02,569 ERROR [STDERR] at antlr.Parser.match(Parser.java:210)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupParser.group(GroupParser.java:117)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.parseGroup(StringTemplateGroup.java:754)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.<init>(StringTemplateGroup.java:264)
      16:21:02,569 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.<init>(StringTemplateGroup.java:244)
      16:21:02,569 ERROR [STDERR] at org.drools.semantics.java.RuleBuilder.<clinit>(Unknown Source)
      16:21:02,569 ERROR [STDERR] at org.drools.compiler.PackageBuilder.addRule(Unknown Source)
      16:21:02,570 ERROR [STDERR] at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)
      16:21:02,570 ERROR [STDERR] at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:64)
      


      I also get this exception further down:

      
      java.lang.IllegalArgumentException: Can't find template consequenceMethod.st
       at org.antlr.stringtemplate.StringTemplateGroup.lookupTemplate(StringTemplateGroup.java:477)
       at org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplateGroup.java:364)
       at org.antlr.stringtemplate.StringTemplateGroup.getInstanceOf(StringTemplateGroup.java:376)
       at org.drools.semantics.java.RuleBuilder.buildConsequence(Unknown Source)
       at org.drools.semantics.java.RuleBuilder.build(Unknown Source)
       at org.drools.semantics.java.RuleBuilder.build(Unknown Source)
       at org.drools.compiler.PackageBuilder.addRule(Unknown Source)
       at org.drools.compiler.PackageBuilder.addPackage(Unknown Source)
       at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:64)
      


      I do not get the error if the rule file is mostly empty (no rules, just the package declaration and imports), however as soon as I add a rule I get this exception.
      I am sure it must be something simple but I can't think what it could be.

      Stuart