[JBoss JIRA] Created: (JBRULES-3014) Too many error messages (and stack dumps!) due to simple syntax error
by Wolfgang Laun (JIRA)
Too many error messages (and stack dumps!) due to simple syntax error
---------------------------------------------------------------------
Key: JBRULES-3014
URL: https://issues.jboss.org/browse/JBRULES-3014
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0.CR1
Person( age > ($age * 2) ) ) ### typo - note the redundant ')'
This produces nested Empty Stack and Class Cast Exceptions, lots of stack dumps and three error messages:
[0,0]: Line 30:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at java.util.Stack.pop(Stack.java:67)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:409)
at org.drools.lang.ParserHelper.end(ParserHelper.java:723)
at org.drools.lang.DRLParser.rule(DRLParser.java:915)
at org.drools.lang.DRLParser.statement(DRLParser.java:248)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:307)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:486)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at express.Main.setup(Main.java:48)
at express.Main.main(Main.java:92)
[0,0]: Line 31:8 unexpected exception at input '"mvel"'. Exception: java.lang.ClassCastException: org.drools.lang.api.CEDescrBuilderImpl cannot be cast to org.drools.lang.api.AttributeSupportBuilder. Stack trace:
java.lang.ClassCastException: org.drools.lang.api.CEDescrBuilderImpl cannot be cast to org.drools.lang.api.AttributeSupportBuilder
at org.drools.lang.ParserHelper.start(ParserHelper.java:667)
at org.drools.lang.DRLParser.stringAttribute(DRLParser.java:1294)
at org.drools.lang.DRLParser.attribute(DRLParser.java:1073)
at org.drools.lang.DRLParser.statement(DRLParser.java:257)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:307)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:486)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at express.Main.setup(Main.java:48)
at express.Main.main(Main.java:92)
[31,8]: [ERR 107] Line 31:8 mismatched input '"mvel"' expecting one of the following tokens: '[package, import, global, declare, function, rule, query]'.
[0,0]: Line 39:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at java.util.Stack.pop(Stack.java:67)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:409)
at org.drools.lang.ParserHelper.end(ParserHelper.java:723)
at org.drools.lang.DRLParser.rule(DRLParser.java:915)
at org.drools.lang.DRLParser.statement(DRLParser.java:248)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:307)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:486)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
at express.Main.setup(Main.java:48)
at express.Main.main(Main.java:92)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3011) Incorrect salience expression => CCE at runtime
by Wolfgang Laun (JIRA)
Incorrect salience expression => CCE at runtime
-----------------------------------------------
Key: JBRULES-3011
URL: https://issues.jboss.org/browse/JBRULES-3011
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0.CR1
function int FSAL(){ return 100; }
rule insFirst
salience ( FSAL ) ## Oops, forgot the parens...
when
then
end
No compile-time error. At runtime we get:
Exception in thread "main" org.drools.RuntimeDroolsException: Unexpected exception executing action org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction@354749
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:996)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:730)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:699)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:218)
at express.Main.execute(Main.java:71)
at express.Main.main(Main.java:93)
Caused by: java.lang.ClassCastException: org.mvel2.util.MethodStub cannot be cast to java.lang.Number
at org.drools.base.mvel.MVELSalienceExpression.getValue(MVELSalienceExpression.java:86)
at org.drools.reteoo.RuleTerminalNode.assertLeftTuple(RuleTerminalNode.java:215)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:138)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:141)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:185)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at org.drools.reteoo.Rete.assertObject(Rete.java:107)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:260)
at org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:343)
at org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:994)
... 5 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3070) Incorrect relational operator usage accepted by compiler
by Wolfgang Laun (JIRA)
Incorrect relational operator usage accepted by compiler
--------------------------------------------------------
Key: JBRULES-3070
URL: https://issues.jboss.org/browse/JBRULES-3070
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
Given
class Person { int age; ... }
the following pattern can be written
Person( $name: name, age > 20 > 50 )
And the pattern matches all Person facts with an age > 50.
a) This should cause an error: a boolean (age > 20) cannot be compared with an integer (50)
b) The result implies that some strange interpretation is in effect.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3059) declare: inconsistent behaviour w.r.t. field redefinition
by Wolfgang Laun (JIRA)
declare: inconsistent behaviour w.r.t. field redefinition
---------------------------------------------------------
Key: JBRULES-3059
URL: https://issues.jboss.org/browse/JBRULES-3059
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
import Person
declare Person
name : String = "Joe" @key # here only @key is recognized; the initialization is not done
end
declare Employee extends Person
custno : int @key
name : String = "Joe" @key # here @key and initialization are recognized
end
If it cannot be honoured, the initialization should cause an error.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3071) NPE in Pattern Builder (invalid unification usage)
by Wolfgang Laun (JIRA)
NPE in Pattern Builder (invalid unification usage)
--------------------------------------------------
Key: JBRULES-3071
URL: https://issues.jboss.org/browse/JBRULES-3071
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
class Person { String name; }
$p1: Person( $name := name, age < 20 )
$p2: Person( $name; )
Exception in thread "main" java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.processPositional(PatternBuilder.java:372)
at org.drools.rule.builder.PatternBuilder.processConstraintsAndBinds(PatternBuilder.java:341)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:262)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:120)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:65)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:81)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1769)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:743)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:358)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:536)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3060) Very odd error message due to unknow class
by Wolfgang Laun (JIRA)
Very odd error message due to unknow class
------------------------------------------
Key: JBRULES-3060
URL: https://issues.jboss.org/browse/JBRULES-3060
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
rule x when
then
X x = new Integer( 42 );
end
without an import or declare for X causes:
Unable to Analyse Expression X x = new Integer( 42 );:
[Error: unknown class or illegal statement: org.mvel2.ParserContext@1e1be92]
[Near : {... X x = new Integer( 42 ); ....}]
^
[Line: 1, Column: 7]
Note: (1) org.mvel2.ParserContext!
Note: (2) The line number is relative to "then", but you'll have to guess that!
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3089) position of "dialect 'mvel'" affects function and/or rule parsing (NPE)
by Wolfgang Laun (JIRA)
position of "dialect 'mvel'" affects function and/or rule parsing (NPE)
-----------------------------------------------------------------------
Key: JBRULES-3089
URL: https://issues.jboss.org/browse/JBRULES-3089
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
The DRL shown below does not compile. Exchanging dialect and function fixes the problem, as does removing the dialect stmt. entirely.
dialect "mvel"
function boolean ping( String x ){
System.out.println( "ping " + x );
return true;
}
rule exa4
when
eval( ping("A") )
then
System.out.println( "Hello world!" );
end
Unable to Analyse Expression ping("A"):
[Error: unable to resolve method using strict-mode: java.lang.Object.ping(java.lang.String)]
[Near : {... ping("A") ....}]
^
[Line: 1, Column: 1] : [Rule name='exa4']
Unable to build expression for 'eval':null 'ping("A")' : [Rule name='exa4']
java.lang.NullPointerException
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-3085) Serializing a package for KnowledgeAgent monitoring requires use of "unstable" API
by Wolfgang Laun (JIRA)
Serializing a package for KnowledgeAgent monitoring requires use of "unstable" API
-----------------------------------------------------------------------------------
Key: JBRULES-3085
URL: https://issues.jboss.org/browse/JBRULES-3085
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0
Serializing a compiled package seems a rational thing to do - after all, there is: <resource source="..." type="PKG" /> and it is recognized by the monitor.
However, you can't simply serialize an org.drools.definition.KnowledgePackage as it is usually done by writing it to an ObjectOutputStream: deserialization in the KnowledgeAgent throws a CCE exception. To make it work, you must use a DroolsObjectOutputStream, which is nothing but a rename of ObjectOutputStream. So I have use DroolsObjectOutputStream, but it is not part of the public API.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months