[ http://jira.codehaus.org/browse/DROOLS-470?page=all ]
Michael Neale resolved DROOLS-470:
----------------------------------
Resolution: Fixed
Fix Version: 2.5
Kris, this should be much better in beta 2, or CVS HEAD.
Problem was JCI CompilerProblem[] was being printed out and ignored. This now
throws exceptions before it gets to runtime. Should report more useful
information.
There is a new exception class in drools-java: JavaSemanticCompileError
getErrors() will return a list of compile problems. Otherwise printing it out
will show a human readable summary of what is wrong.
> condition ending with ; is not considered as wrong when parsing ruleset but
> generates error when asserting an object
> --------------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-470
> URL: http://jira.codehaus.org/browse/DROOLS-470
> Project: drools
> Type: Bug
> Components: semantics.java
> Versions: 2.5
> Reporter: Kris Verlaenen
> Assignee: Michael Neale
> Priority: Minor
> Fix For: 2.5
>
>
> When creating a java condition ending with a semi-colon, loading of the
> ruleset is successful.
> e.g. when creating a rule containing
> <java:condition>
> true;
> </java:condition>
> then
> ruleBase =
> RuleBaseLoader.loadFromInputStream(this.getClass().getResourceAsStream(
> "/myrule.java.drl" ))
> does not generate any errors.
> Although, when asserting an object in the working memory that leads to the
> evaluation of that condition, first some output is written to the system out,
> followed by an exception:
> drools/org/MyRuleSet_1136384249796/java/Allow_ProviderA_access_0.java(26)
> Syntax error on token ";", delete this token
> drools/org/MyRuleSet_1136384249796/java/Allow_ProviderA_access_0.java(26)
> Syntax error on token ";", delete this token
> java.lang.NoClassDefFoundError:
> drools/org/MyRuleSet_1136384249796/java/Allow_ProviderA_access_0
> at
> drools.org.MyRuleSet_1136384249796.java.Allow_ProviderA_access_0Invoker$Condition_1Invoker.invoke(Allow_ProviderA_access_0Invoker.java:36)
> at
> org.drools.semantics.java.JavaCondition.isAllowed(JavaCondition.java:172)
> at org.drools.reteoo.ConditionNode.assertTuple(ConditionNode.java:154)
> at
> org.drools.reteoo.TupleSource.propagateAssertTuple(TupleSource.java:118)
> at org.drools.reteoo.ParameterNode.assertObject(ParameterNode.java:126)
> at
> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:173)
> at org.drools.reteoo.Rete.assertObject(Rete.java:111)
> at org.drools.reteoo.RuleBaseImpl.assertObject(RuleBaseImpl.java:193)
> at
> org.drools.reteoo.WorkingMemoryImpl.assertObject(WorkingMemoryImpl.java:373)
> at
> org.drools.reteoo.WorkingMemoryImpl.assertObject(WorkingMemoryImpl.java:348)
> If a ; is not allowed in a condition, this problem should be detected when
> parsing the ruleset.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira