Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-rc-1
-
Fix Version/s: 2.0-rc-2
-
Component/s: semantics.java
-
Labels:None
-
Environment:Windows XP environment, JDK 1.4.2, drools 2.0-rc1, developing Java-XML ruleset files
-
Number of attachments :
Description
I'm trying to develop a little tool around drools to make development of large ruleset easier for me.
By doing this I found a curious behaviour, the reason why the ruleset was not compileable never reached my application source but was logged into the console. The reason is a codestatement in org.drools.semantics.java.JavaScriptEvaluator constructor (see below).
Any problem is swallowed by this code statement and ends up in a runtime exception without the possibility to give a concrete compile problem reason to the user frontend.
In my concrete case the exception
"org.codehaus.janino.Java$CompileException: Line 1, Column 39: Unknown variable or type "block""
becomes
"org.drools.smf.FactoryException: null"
try
{ c = this.compileAndLoad( compilationUnit, DebuggingInformation.ALL, className ); }catch ( Exception e )
{ e.printStackTrace(); throw new RuntimeException( ); // ??? }
Should this be fixed in the Drools 2.0 branch?
For Drools v2.0 (which must remain JDK1.3 compatible), a quick solution might be to change the offending line to:
> throw new RuntimeException(e.getMessage());
For Drools v2.1 (which no longer supports JDK1.3), a better quick solution might be to change the offending line to:
> throw new RuntimeException(e);