Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-2757

ConstraintVerifier Bavet error message: missing maybe

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 8.26.0.Final
    • None
    • optaplanner-test
    • None
    • 2022 Week 29-31 (from Jul 18)
    • 2
    • NEW
    • NEW

      To reproduce:

      • Take optaplanner-quickstarts hello-world
      • exclude non-bavet stuff:
          <dependency>
            <groupId>org.optaplanner</groupId>
            <artifactId>optaplanner-core</artifactId>
            <exclusions>
              <exclusion>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-constraint-drl</artifactId>
              </exclusion>
              <exclusion>
                <groupId>org.optaplanner</groupId>
                <artifactId>optaplanner-constraint-streams-drools</artifactId>
              </exclusion>
            </exclusions>
          </dependency>
      
      • Adjust TimeTableApp to use Bavet.
      • Run "mvn clean install". You get this error message:
      [ERROR] org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest.teacherTimeEfficiency  Time elapsed: 0.003 s  <<< ERROR!
      java.lang.IllegalStateException: 
      Constraint Streams implementation was not found on the classpath.
      Maybe include org.optaplanner:optaplanner-constraint-streams-drools dependency in your project?
      Maybe ensure your uberjar bundles META-INF/services from included JAR files?
              at org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest.teacherTimeEfficiency(TimeTableConstraintProviderTest.java:75)
      

      What's wrong? You forgot to switch the tests to bavet too! Very easy to do, but the error message puts you on the wrong path.

      Proposal A)
      Add an extra Maybe line:
      "Maybe you want to use Bavet instead of Drools: in your tests, call ConstraintVerifier.build(...).withConstraintStreamImplType(BAVET).\n"

              lpetrovi@redhat.com Lukáš Petrovický (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: