<br><font size=2 face="sans-serif">Michael,</font>
<br>
<br><font size=2 face="sans-serif">In this exact case I am not expecting
the scanner to ever find an updated resource; however, the changeset is
configured to read one resource from a URL and another from the classpath.
&nbsp;The resource from the URL is expected to change, but the one from
the classpath is not. &nbsp;We have a use case where we may need classpath
resources to be scanned, but I'm not sure it will ever come up. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">Unfortunately I don't think that we
can reference that resource any way other than the classpath at this moment,
but we do have another workaround. &nbsp;Previous to Drools 5 we had a
custom way of refreshing our resources which I think we will go back to
for now. </font>
<br>
<br><font size=2 face="sans-serif">Should I log a feature request for this
change?</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/07/2009
05:29:56 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/07/2009 05:31 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 - I have seen that issue before reported by others. But you<br>
&gt; just explained the cause ! - I don't often use the classpath scanner<br>
&gt; myself, so never thought of that.<br>
&gt; <br>
&gt; Yes the lastModified being zero is a problem...<br>
&gt; <br>
&gt; OK, well I think perhaps the solution would be if lastModified is
not<br>
&gt; a valid value, to NOT use that to decide availablility.<br>
&gt; <br>
&gt; I think using a scanner on &nbsp;a classpath resource is a bit unusual
to<br>
&gt; start with, but it is possible in various containers to dynamically<br>
&gt; change the classpath, so it kind of technically makes sense.<br>
&gt; <br>
&gt; If I had things in the classpath, I would assume they are constant
-<br>
&gt; but I assume you are actually expecting the scan to pick up changes
in<br>
&gt; a future ?<br>
&gt; <br>
&gt; (in the meantime, if you can avoid the classpath one that problem<br>
&gt; should go away).<br>
&gt; <br>
&gt; On Thu, Oct 8, 2009 at 5:53 AM, Steve Ronderos &lt;steve.ronderos@ni.com&gt;
wrote:<br>
&gt; &gt;<br>
&gt; &gt; Hello Dev List,<br>
&gt; &gt;<br>
&gt; &gt; I encountered an issue today with my KnowledgeAgent removing
resources from<br>
&gt; &gt; its RuleBase shortly after creating it. &nbsp;I have the ResourceChangeScanner<br>
&gt; &gt; running in my application.<br>
&gt; &gt;<br>
&gt; &gt; I tracked the issue back to the scan() method in ResourceChangeScannerImpl.<br>
&gt; &gt; &nbsp;It appears that the method is trying to identify resources
that are no<br>
&gt; &gt; longer available and remove them from both the RuleBase and future
scans.<br>
&gt; &gt; &nbsp;To do this it is checking lastModified on the resource
and on a result of 0<br>
&gt; &gt; removing the resource. &nbsp;The resources that I configured
in my change-set<br>
&gt; &gt; definitely still exist, but due to URL handler implementation
provided by my<br>
&gt; &gt; classloader, getLastModified always returns 0. &nbsp;(The resource
I'm retrieving<br>
&gt; &gt; is coming from a jar that is in my application's classpath and
the URL<br>
&gt; &gt; handler implementation is oracle.classloader.SharedCodeSourceURL)<br>
&gt; &gt;<br>
&gt; &gt; Do you think it would be possible for the scan to identify unavailable<br>
&gt; &gt; resources some other way than with the lastModified? and then
if<br>
&gt; &gt; lastModified is 0 maybe always or never update the resource?
I'm not sure<br>
&gt; &gt; what the best approach to that would be, but removing resources
when their<br>
&gt; &gt; lastModified is 0 seems incorrect to me.<br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt;<br>
&gt; &gt; Steve Ronderos<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>