1

I'm using joda-time to keep track of several different types of dates (DateTime and DateMidnight) in a Drools file. As part of the when condition, I get the date of an object and then compare the dates of all other objects to make sure there's not a more recent object. The dates are in the same format (DateTime), but I consistently receive the following error when I try to send it a payload via Tomcat:

Caused by: java.lang.NoSuchMethodError: org.joda.time.DateTime.compareTo(Lorg/joda/time/DateTime;)
at edu.measure.growth.Rule_assume_first_measurement_is_valid586933554.defaultConsequence(Rule_assume_first_measurement_is_valid586933554.java:7)
at edu.measure.growth.Rule_assume_first_measurement_is_valid586933554DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
at edu.measure.growth.Rule_assume_first_measurement_is_valid586933554DefaultConsequenceInvoker.evaluate(Unknown Source)

This is the rule that it is referencing in the error log:

rule "assume first measurement is valid"
when
    // consider all measurements that have not been validated
    $m: Measurement($type: parameter, valid == false, $dt: date)
    // verify no measurements occur after target date
    not Measurement(parameter == $type, date<$dt))
then
    modify($m) {setValid(true);}
end

It seems to not want to compare using the < operator. Is this a common error others have gotten? I haven't been able to find anything about how to fix it, so any help would be greatly appreciated!

1
  • For future reference, this was a bug that was fixed, but it reappeared in DROOLS.
    – jschabs
    May 19, 2017 at 15:52

1 Answer 1

1

What DROOLS version are you using?

It seems it was a bug that got fixed: https://issues.jboss.org/browse/DROOLS-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.