Thanks for the directions Michael. It runs now.
For those who face the same problem, here is how you should do it:
PackageBuilder builder = new PackageBuilder();
builder.addPackageFromDrl(new
InputStreamReader(CreditExample.class.getResourceAsStream("/credit.drl")),
new
InputStreamReader(CreditExample.class.getResourceAsStream("/credit.dsl")));
instead of what has been shown in the trailblazer.
Michael Neale wrote:
looks like you are calling the wrong API - you need to
pass in a Reader to the .dsl file as well.
On 11/1/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
wrote:
Dear all,
I'm facing a problem when i'm following the trailblazer
demos "Extending the simple credit system example with its own Domain
Specific Language". I managed to get the first demo running smoothly. I
followed the demo (the one using a Domain Specific Language) step by
step but i couldn't get mine to run without exception (i paste it below
for your reference).
java.lang.IllegalArgumentException: Unable to use expander. Make
sure a expander or dsl config is being passed to the parser.
[ExpanderResolver was not set].
at org.drools.lang.RuleParser.expander(Unknown Source)
at org.drools.lang.RuleParser.prolog(Unknown Source)
at org.drools.lang.RuleParser.compilation_unit(Unknown Source)
at org.drools.compiler.DrlParser.compile(Unknown Source)
at org.drools.compiler.DrlParser.parse(Unknown Source)
at org.drools.compiler.DrlParser.parse(Unknown Source)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(Unknown Source)
at com.livetrail.CreditExample.main(CreditExample.java:21)
Is this a known issue? or am i doing it wrong?
--
Warm regards,
Jacky Wong
---------------------------------------------------------------------
To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
--
Warm regards,
Jacky Wong
Software Engineer
Qinetics Solution Berhad
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email
|