Did you try using ResourceFactory.newFileResource(&quot;C:\\savedRules\\rule.drl&quot;)? A FileResource is more appropriated for your case I think.<div><br></div><div>By the way, this kind of questions should go in <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>. I&#39;m forwarding it now.</div>

<div><br></div><div>Best,<br clear="all"><br>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX<br><br>Esteban Aliverti<br>- Developer @ <a href="http://www.plugtree.com" target="_blank">http://www.plugtree.com </a><br>- Blog @ <a href="http://ilesteban.wordpress.com" target="_blank">http://ilesteban.wordpress.com</a><br>


<br><br><div class="gmail_quote">On Mon, Feb 14, 2011 at 8:21 AM, stefano82 <span dir="ltr">&lt;<a href="mailto:illidan.guru@gmail.com">illidan.guru@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
hello,<br>
i devloped a custom rule editor able to create drl file and save them in<br>
file system under a given directory. (e.g. c:\savedRules\rule.drl).<br>
The problem is that once the rule is saved i need to run it with drools<br>
engine.<br>
In my class i try to load rule in this way:<br>
<br>
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
kbuilder.add(ResourceFactory.newClassPathResource(&quot;c:\savedRules\rule.drl&quot;),<br>
ResourceType.DRL);<br>
<br>
but its doesn&#39;t work. the exception is &quot;rule.drl cannot be opened because it<br>
does not exist&quot; but it actually exists....<br>
<br>
What am I doing wrong? there is another way to load rules directly from file<br>
sistem?<br>
<br>
thanks in advice.<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-load-drl-rule-file-from-file-system-tp2491856p2491856.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Drools-5-load-drl-rule-file-from-file-system-tp2491856p2491856.html</a><br>


Sent from the Drools - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</font></blockquote></div><br></div>