I think because the stream has reached the end once you load it the first time. Get a fresh reader from a fresh stream and it should work. <br><br><div><span class="gmail_quote">On 8/13/07, <b class="gmail_sendername">hypnosat7
</b> <<a href="mailto:ablarbi@yahoo.fr">ablarbi@yahoo.fr</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>But why the expand methode in
DrlParser.parse(final String source, final<br>Reader dsl) can't build the expander with an inputStreamReader on a used<br>ressource ?<br>And If I use two FileReader on the same dsl file it work's<br><br>example :
<br><br> dslReader = new<br>InputStreamReader(getClass().getResourceAsStream(dslSource));<br> ...<br> DSLMappingFile dslMappingFile = new DSLMappingFile();<br> dslMappingFile.parseAndLoad(dslReader);<br> ...<br>
builder.addPackageFromDrl(drlReader, dslReader);<br><br>the package built is invalid because the mappings property in the expander<br>is empty<br><br>Any explaination to this ?<br>thanks<br><br><br><br><br>hypnosat7 wrote:
<br>><br>><br>> In fact I used the dsl Reader before to build a DefaultDslMapping. So the<br>> problem is fixed<br>><br>><br>> hypnosat7 wrote:<br>>><br>>> Hi,<br>>> I have an error when I try to buil a package using a dsl Reader :
<br>>> org.drools.lang.ExpanderException@983d95[16,1]: unknown:16:1 Unexpected<br>>> token 'une'<br>>><br>>> I try to debug it with eclipse and I find no mappings in the variable<br>>> "expander"
<br>>><br>>> final String expanded = expander.expand( source );<br>>><br>>> I'ts in the method DrlParser.parse(final String source, final Reader dsl)<br>>> throws DroolsParserException<br>
>><br>>> So what can be the problem<br>>><br>><br>><br><br>--<br>View this message in context: <a href="http://www.nabble.com/expander-mappings-empty-%21-tf4260034.html#a12124221">http://www.nabble.com/expander-mappings-empty-%21-tf4260034.html#a12124221
</a><br>Sent from the drools - user mailing list archive at <a href="http://Nabble.com">Nabble.com</a>.<br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>