<br><font size=2 face="sans-serif">Michael,</font>
<br>
<br><font size=2 face="sans-serif">I've logged the issue (</font><a href="https://jira.jboss.org/jira/browse/JBRULES-2293"><font size=2 face="sans-serif">https://jira.jboss.org/jira/browse/JBRULES-2293</font></a><font size=2 face="sans-serif">).
&nbsp;I agree that classpath resources should not be scanned. &nbsp;That
would solve my immediate problem.</font>
<br>
<br><font size=2 face="sans-serif">One last note, I still don't think that
checking lastModified != 0 to determine existence is ideal, there could
be other scenarios where the lastModified method is not implemented and
returns 0. &nbsp;Is there a better way to check for resource existence
other than lastModified?</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif"><br>
</font><font size=3>Steve Ronderos</font>
<br>
<br><tt><font size=2>rules-dev-bounces@lists.jboss.org wrote on 10/08/2009
05:13:17 PM:<br>
<br>
&gt; [image removed] </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Re: [rules-dev] Issue with ResourceChangeScanner</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Michael Neale </font></tt>
<br><tt><font size=2>&gt; <br>
&gt; to:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Rules Dev List</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; 10/08/2009 05:14 PM</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Sent by:</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; rules-dev-bounces@lists.jboss.org</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Please respond to Rules Dev List</font></tt>
<br><tt><font size=2>&gt; <br>
&gt; Hi Steve - ok - I am leaning towards insisting that classpath<br>
&gt; resources are not scanned for - just loaded once. There are cases<br>
&gt; where you can update a classpath value on the fly, but really, I think<br>
&gt; using file/database/http would be better for that sort of dynamic<br>
&gt; changes...<br>
&gt; <br>
&gt; Please do log it as a bug, let us know and I will make it critical,
as<br>
&gt; I think its kinda broken and not workable at the moment.<br>
&gt; <br>
&gt; On Fri, Oct 9, 2009 at 12:46 AM, Steve Ronderos &lt;steve.ronderos@ni.com&gt;
wrote:<br>
&gt; &gt;<br>
&gt; &gt; Michael,<br>
&gt; &gt;<br>
&gt; &gt; In this exact case I am not expecting the scanner to ever find
an updated<br>
&gt; &gt; resource; however, the changeset is configured to read one resource
from a<br>
&gt; &gt; URL and another from the classpath. &nbsp;The resource from the
URL is expected<br>
&gt; &gt; to change, but the one from the classpath is not. &nbsp;We have
a use case where<br>
&gt; &gt; we may need classpath resources to be scanned, but I'm not sure
itwill ever<br>
&gt; &gt; come up.<br>
&gt; &gt;<br>
&gt; &gt; Unfortunately I don't think that we can reference that resource
any way<br>
&gt; &gt; other than the classpath at this moment, but we do have another
workaround.<br>
&gt; &gt; &nbsp;Previous to Drools 5 we had a custom way of refreshing
our resources which<br>
&gt; &gt; I think we will go back to for now.<br>
&gt; &gt;<br>
&gt; &gt; Should I log a feature request for this change?<br>
&gt; &gt;<br>
&gt; &gt; Steve Ronderos<br>
&gt; &gt;<br>
&gt; &gt; rules-dev-bounces@lists.jboss.org wrote on 10/07/2009 05:29:56
PM:<br>
&gt; &gt;<br>
&gt; &gt;&gt; [image removed]<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Re: [rules-dev] Issue with ResourceChangeScanner<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Michael Neale<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; to:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Rules Dev List<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; 10/07/2009 05:31 PM<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Sent by:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; rules-dev-bounces@lists.jboss.org<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Please respond to Rules Dev List<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Hi Steve - I have seen that issue before reported by others.
But you<br>
&gt; &gt;&gt; just explained the cause ! - I don't often use the classpath
scanner<br>
&gt; &gt;&gt; myself, so never thought of that.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Yes the lastModified being zero is a problem...<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; OK, well I think perhaps the solution would be if lastModified
is not<br>
&gt; &gt;&gt; a valid value, to NOT use that to decide availablility.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I think using a scanner on &nbsp;a classpath resource is
a bit unusual to<br>
&gt; &gt;&gt; start with, but it is possible in various containers to dynamically<br>
&gt; &gt;&gt; change the classpath, so it kind of technically makes sense.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; If I had things in the classpath, I would assume they are
constant -<br>
&gt; &gt;&gt; but I assume you are actually expecting the scan to pick
up changes in<br>
&gt; &gt;&gt; a future ?<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; (in the meantime, if you can avoid the classpath one that
problem<br>
&gt; &gt;&gt; should go away).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Thu, Oct 8, 2009 at 5:53 AM, Steve Ronderos &lt;steve.ronderos@ni.com&gt;<br>
&gt; &gt;&gt; wrote:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Hello Dev List,<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; I encountered an issue today with my KnowledgeAgent
removing resources<br>
&gt; &gt;&gt; &gt; from<br>
&gt; &gt;&gt; &gt; its RuleBase shortly after creating it. &nbsp;I have
the<br>
&gt; &gt;&gt; &gt; ResourceChangeScanner<br>
&gt; &gt;&gt; &gt; running in my application.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; I tracked the issue back to the scan() method in<br>
&gt; &gt;&gt; &gt; ResourceChangeScannerImpl.<br>
&gt; &gt;&gt; &gt; &nbsp;It appears that the method is trying to identify
resources that are no<br>
&gt; &gt;&gt; &gt; longer available and remove them from both the RuleBase
and future<br>
&gt; &gt;&gt; &gt; scans.<br>
&gt; &gt;&gt; &gt; &nbsp;To do this it is checking lastModified on the
resource and on a result<br>
&gt; &gt;&gt; &gt; of 0<br>
&gt; &gt;&gt; &gt; removing the resource. &nbsp;The resources that I configured
in my change-set<br>
&gt; &gt;&gt; &gt; definitely still exist, but due to URL handler implementation
provided<br>
&gt; &gt;&gt; &gt; by my<br>
&gt; &gt;&gt; &gt; classloader, getLastModified always returns 0. &nbsp;(The
resource I'm<br>
&gt; &gt;&gt; &gt; retrieving<br>
&gt; &gt;&gt; &gt; is coming from a jar that is in my application's classpath
and the URL<br>
&gt; &gt;&gt; &gt; handler implementation is oracle.classloader.SharedCodeSourceURL)<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Do you think it would be possible for the scan to identify
unavailable<br>
&gt; &gt;&gt; &gt; resources some other way than with the lastModified?
and then if<br>
&gt; &gt;&gt; &gt; lastModified is 0 maybe always or never update the resource?
I'm not<br>
&gt; &gt;&gt; &gt; sure<br>
&gt; &gt;&gt; &gt; what the best approach to that would be, but removing
resources when<br>
&gt; &gt;&gt; &gt; their<br>
&gt; &gt;&gt; &gt; lastModified is 0 seems incorrect to me.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Thanks,<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Steve Ronderos<br>
&gt; &gt;&gt; &gt; _______________________________________________<br>
&gt; &gt;&gt; &gt; rules-dev mailing list<br>
&gt; &gt;&gt; &gt; rules-dev@lists.jboss.org<br>
&gt; &gt;&gt; &gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-dev</font></tt></a><tt><font size=2><br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; --<br>
&gt; &gt;&gt; Michael D Neale<br>
&gt; &gt;&gt; home: </font></tt><a href=www.michaelneale.net><tt><font size=2>www.michaelneale.net</font></tt></a><tt><font size=2><br>
&gt; &gt;&gt; blog: michaelneale.blogspot.com<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; rules-dev mailing list<br>
&gt; &gt;&gt; rules-dev@lists.jboss.org<br>
&gt; &gt;&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-dev</font></tt></a><tt><font size=2><br>
&gt; &gt;<br>
&gt; &gt; _______________________________________________<br>
&gt; &gt; rules-dev mailing list<br>
&gt; &gt; rules-dev@lists.jboss.org<br>
&gt; &gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-dev</font></tt></a><tt><font size=2><br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; -- <br>
&gt; Michael D Neale<br>
&gt; home: </font></tt><a href=www.michaelneale.net><tt><font size=2>www.michaelneale.net</font></tt></a><tt><font size=2><br>
&gt; blog: michaelneale.blogspot.com<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; rules-dev@lists.jboss.org<br>
&gt; </font></tt><a href="https://lists.jboss.org/mailman/listinfo/rules-dev"><tt><font size=2>https://lists.jboss.org/mailman/listinfo/rules-dev</font></tt></a><tt><font size=2><br>
</font></tt>