Hi Steve - I have seen that issue before reported by others. But you just explained the cause ! - I don't often use the classpath scanner myself, so never thought of that.
Yes the lastModified being zero is a problem... OK, well I think perhaps the solution would be if lastModified is not a valid value, to NOT use that to decide availablility. I think using a scanner on a classpath resource is a bit unusual to start with, but it is possible in various containers to dynamically change the classpath, so it kind of technically makes sense. If I had things in the classpath, I would assume they are constant - but I assume you are actually expecting the scan to pick up changes in a future ? (in the meantime, if you can avoid the classpath one that problem should go away). On Thu, Oct 8, 2009 at 5:53 AM, Steve Ronderos <[email protected]> wrote: > > Hello Dev List, > > I encountered an issue today with my KnowledgeAgent removing resources from > its RuleBase shortly after creating it. I have the ResourceChangeScanner > running in my application. > > I tracked the issue back to the scan() method in ResourceChangeScannerImpl. > It appears that the method is trying to identify resources that are no > longer available and remove them from both the RuleBase and future scans. > To do this it is checking lastModified on the resource and on a result of 0 > removing the resource. The resources that I configured in my change-set > definitely still exist, but due to URL handler implementation provided by my > classloader, getLastModified always returns 0. (The resource I'm retrieving > is coming from a jar that is in my application's classpath and the URL > handler implementation is oracle.classloader.SharedCodeSourceURL) > > Do you think it would be possible for the scan to identify unavailable > resources some other way than with the lastModified? and then if > lastModified is 0 maybe always or never update the resource? I'm not sure > what the best approach to that would be, but removing resources when their > lastModified is 0 seems incorrect to me. > > Thanks, > > Steve Ronderos > _______________________________________________ > rules-dev mailing list > [email protected] > https://lists.jboss.org/mailman/listinfo/rules-dev > > -- Michael D Neale home: www.michaelneale.net blog: michaelneale.blogspot.com _______________________________________________ rules-dev mailing list [email protected] https://lists.jboss.org/mailman/listinfo/rules-dev
