As well as the message not making sense the exception should also really be UnsupportedOperationException, of course the preference is for someone to implement
it and make it supported!
Thomas
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org]
On Behalf Of Esteban Aliverti
Sent: 06 January 2012 09:14
To: Rules Users List
Subject: Re: [rules-users] Resource Change Scanner Service modified date error
Could you please share with us how are you adding your resources to the agent? According to what you are saying I assume you are using a ReaderResource. According to Drools code, ReaderResource doesn't support most of org.drools.io.internal.InternalResource
methods. Some of these methods (i.e. getLastModified()) are used by ResourceScanner to check if a resource has actually changed.
So if we take a look at ReaderResource.getLastModified() we will see this:
public long getLastModified() {
throw new IllegalStateException( "reader does have a modified date" );
}
You can find the whole source code here: https://github.com/droolsjbpm/drools/blob/master/drools-core/src/main/java/org/drools/io/impl/ReaderResource.java
So, don't expect this to work :)
There are 2 things you can do:
In my opinion, Bug 733008 must be reopened until someone (maybe you Dean) provides a correct implementation of ReaderResource.
Best Regards,
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com
On Fri, Jan 6, 2012 at 8:53 AM, Dean <dean@qualica.com> wrote:
I'm pretty sure this issue is the same as Bug 733008
(https://bugzilla.redhat.com/show_bug.cgi?id=733008).
I have updated the class from Bug 733008 to reproduce the bug in Drools
5.4.0.Beta1:
http://drools.46999.n3.nabble.com/file/n3637279/AgentTest.java
AgentTest.java
It doesn't seem to be possible to scan a resource for changes at all. Even
if I execute ResourceFactory.getResourceChangeScannerService().scan();
directly, I get the same error message:
[2012-01-06 09:47:57,144:exception]
java.lang.IllegalStateException: reader does have a modified date
at
org.drools.io.impl.ReaderResource.getLastModified(ReaderResource.java:64)
at
org.drools.io.impl.ResourceChangeScannerImpl.scan(ResourceChangeScannerImpl.java:166)
at
org.drools.io.impl.ResourceChangeScannerImpl$ProcessChangeSet.run(ResourceChangeScannerImpl.java:311)
at java.lang.Thread.run(Thread.java:662)
(As a side note the error message should probably read: reader does /not/
have a modified date)
Regards
Dean
--
View this message in context:
http://drools.46999.n3.nabble.com/Resource-Change-Scanner-Service-modified-date-error-tp3634802p3637279.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users